Time based opening or closing of a trade

Forums ProRealTime English forum ProRealTime platform support Time based opening or closing of a trade

  • This topic has 1 reply, 2 voices, and was last updated 2 years ago by avatarJS.
Viewing 2 posts - 1 through 2 (of 2 total)
  • #197475

     

    Hi Happy Coders,

    Is there a way we can open or close a trade on a time basis,

    Thanks

    #197477
    JS

    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)

     

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login