Reset Tradeindex each day?

Forums ProRealTime English forum ProOrder support Reset Tradeindex each day?

Viewing 6 posts - 1 through 6 (of 6 total)
  • #27262

    Hi new to coding can you help me with the the tradeIndex. I want to re set it to to nil at the start of ever trading day for back testing.  David

    #27265

    Tradeindex is a built-in instruction, it cannot be reset like a variable.
    What do you want to do exactly?

    #27281

    I want to enter the market by a moving average crossing and then set a limit for that trade say 30 points but if the moving average then crosses latter

    the same trading day I only want to take the one trade per day.

    “IF NOT LongOnMarket AND Time > startime AND c2 AND TRADEINDEX < 1 THEN
    BUY 10 PERPOINT AT MARKET ”

    c2 = the moving average cross and i am using it on a minute time frame so getting many crossing during the day . The above is only taking the one trade per day but when you go to back test it only shows the first trade on the first day of the test.

    David

     

    #27289

    It’s a common question here on forum, please find below some links that will help you code it:

    https://www.prorealcode.com/topic/how-to-operate-just-once-in-a-day/

    https://www.prorealcode.com/topic/only-one-trade-per-day-on-3-strategies/

    https://www.prorealcode.com/topic/ein-trade-pro-tag/

    etc. You might find some extra links too by using the Search feature of the website.

    #27309

    Many thanks very helpful Nicolas.

    #27600

    https://www.prorealcode.com/topic/only-one-trade-per-day-on-3-strategies/

    Thanks used the code from above and able to back test and only taking one trade per day.

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

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