Close a trade buy/sell based on number of hours

Forums ProRealTime English forum ProOrder support Close a trade buy/sell based on number of hours

Viewing 7 posts - 1 through 7 (of 7 total)
  • #112148

    Hi there,

    Does anyone know how to close a position based on number of hours?

    Thank you.

     

    #112154

    Put this, example with 10 hours for both long and short.

     

     

     

    #112162

    Mauro‘s code is correct if you are using 1-hour TF, if you are using lower TF’s you’ll have to write:

     

    #112176

    Yes Roberto you are right I answered for number of bars.

    #112177

    Thank you both Mauro and Roberto. Very much appreciate your assistance.

    #112201

    There is a small issue with your code Roberto as it does not exit exactly ten hours after a trade is opened when used on a faster time frame than hourly. You would need to record the minute and/or second when a trade is opened and then count the hours and then check for the same minute and/or second in the tenth hour to work out when to precisely close the trade.

    #112207

    I think he doesn’t need an exact number of hours, but if he does I can do it.

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

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