How to operate just once in a day?

Forums ProRealTime English forum ProOrder support How to operate just once in a day?

Viewing 2 posts - 1 through 2 (of 2 total)
  • #6676

    Hi,

    In my trading system I would like to operate in FOREX market just once in a single day. For example if certain conditions are met the system enters. Imagine that after a certain number of hours the system exit from the market either because of exit conditions or because of stop loss or trailing stop. I would like the system avoids entering again in the market within the same day and instead waits for the next day to enter again.

    A possible way to implement this test is setting a variable at 0 at beginning of the day. If the system enters (long/short conditions met) the variable is set to 1. This prevents the system to enter again in the same day since I add the condition variable=0 in the long/short conditions. But I do not know how to reset the variable at the beginning of each day-trading operating hours.

    Thanks

    #6679

    You can reset easily your variable each day by testing the intraday bar index with the instruction : intradaybarindex

    Reset your variable by doing this:

    And set your variable “tradedtoday” to 1 when you launch a trade. Test it before initiate a new trade. That’s all 🙂

    You could have tested also if the daily open candle was the same as the one saved before in a variable, that’s what I do in other platform programming.

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