Hi Happy Coders,
Is there a way we can open or close a trade on a time basis,
Thanks
JSParticipant
Senior
Hi @UkDownUnder
Yes, you can…
To open a time related position:
IF Time >= 090000 AND Not OnMarket THEN
Buy positionsize contract at market
EndIf
IF Time = 100000 THEN
TradeOK = 1
To close a time related position:
if shortonmarket and time = 230000 THEN
EXITSHORT positionsize CONTRACT AT MARKET
ENDIF
if longonmarket and time = 000000 THEN
SELL positionsize CONTRACT AT MARKET
ENDIF
(Time ranges from 000000 to 235959)