I'm trying a pretty simple strategy, with these setups. The strategy is designed to leave positions open until they reach the profit target/stoploss, without exiting at session close. This means that trades can be closed while the market is open. NQ has "a daily maintenance period from 5:00 p.m. - 6:00 p.m. ET (4:00 p.m. - 5:00 p.m. CT)" so no market orders can be traded during that time, and limit orders can´t get a fill. I'm not sure if limit orders can be entered at that time, and perhaps NT is taking the best ask/best bid price, and closing the trade for that reason.
I am attaching screenshots with the executed prices on a sim account, so you can see that it is not in the traded price range on the chart, either time (5:54 both trades, EST time). This is not expected behavior on a real account.
Thank you.
Calculate = Calculate.OnBarClose;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = false;
ExitOnSessionCloseSeconds = 30;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.Standard;
Slippage = 0;
StartBehavior = StartBehavior.ImmediatelySubmitSynchronizeAccount;
TimeInForce = TimeInForce.Gtc;
TraceOrders = false;
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 12000;
--------------------
if ( ((EMA1[0] > EMA2[0])
&& (Close[0]>smaSlow[0])
&& ((ToTime(Times[0][0]) >= StopTime && ToTime(Times[0][0]) <= StartTime) == false)
&& ((ToTime(Times[0][0]) >= StopTime2 && ToTime(Times[0][0]) <= StartTime2) == false)
&& Position.MarketPosition == MarketPosition.Flat
(some other logic here with the emas)
)
{
SetStopLoss(@"LE_", CalculationMode.Price, Close[0] - (Stop * TickSize), false);
SetProfitTarget("LE_", CalculationMode.Price, Close[0] + (Limit * TickSize));
EnterLong(Convert.ToInt32(LotsSize), @"LE_");
}

Comment