The intention is not to send orders during the premarket period only to send orders during the regular session if the premarketcriteria and the regular session criteria are both true. For some reason it is not generating orders. Please help.
Thanks
Code: Select all
Inputs:
Barsago(5);
variables:
intrabarpersist bool PreMarketCriteria(false);
PreMarketCriteria = false;
if Time > 810 and Time < 920
and Average(Close, 30) < Close then
begin
PreMarketCriteria = true;
end
else
begin
PreMarketCriteria = false;
end;
if Time > 940
and Time < 1600
and PreMarketCriteria
and Average(Close, 5) < Close[Barsago]
and MarketPosition = 0 then
begin
Buy ("LEMAXTIME") Next bar at Market;
end;
// Built in Stops and Targets
SetStopLoss( 30 ) ;
SetProfitTarget( 30 ) ;
// Set Exit on Close for Backtesting
SetExitonClose;