I want to implement the following logic:
If the Close today is higher than the Close yesterday, buy on today's close and sell at tomorrows close.
Short analog.
Seems like forcing NT to buy or short on the Close of the actual bar is only possible with Index -1
with:
if (Close[-1] >Close[0])
{
EnterLongStopLimit(1, Close[-1], Close[-1], "Long-Entry");
}
short analog,
and to exit on the actual bar with:
if (BarsSinceEntry("Long-Entry") == 0 )
{
ExitLongStopLimit(Close[-1], Close[-1], "Exit Long", "Long-Entry");
}
Unfurtunately that's not supported by the support.
The system is always in market, evaluating Close-prices only and positions are sometimes subject to reversion.
I just realized that NT is generating exit orders by itself in that case and so an open position is getting two exit-orders. So I figured out a work around for that case.
But it's still not always working-there are bars where no new entries are generated, although I set max. entries per direction to 2.
I have uploaded the strategy - so if anyone knows a fix - awesome!
Maybe there is a much simplier way to code a system that evaluates Closes only - so in that case - please tell me :-)
I don't want to belief it's unpossible with NT...
Thanks in advance!
Stephan
Comment