help to code a position automation

Forums ProRealTime English forum ProBuilder support help to code a position automation

Viewing 10 posts - 1 through 10 (of 10 total)
  • #235926

    Hello, I am looking to automate a daily position taking but I have no coding knowledge.

    The parameters looked like this:

    • Calculate the price variation in % between yesterday’s 09:05 closing and today’s 9:00 opening.

    —> If the variation is greater than 0.5% then take a buy on the market instantly with 1% of the capital (100 pts of SL / 100 pts of TP)

    —> If the variation is less than -0.5% then take a short on the market instantly with 1% of the capital (100 pts of SL / 100 pts of TP)

    I would need the position taking to be done as soon as the 9:00 candle appears, as close as possible to the open to fit with my manual backtests.

     

    Example:

    Close at 9:05 on 07/25th is at 39856

    Open at 9:00 on 07/26th is at 40082

    = a variation of +0.56%, the bot must long instantly in this case because we are above the 0.5% variation requested to enter a position.

     

    Thank you in advance for your valuable help.

    #235946

    There you go:

     

    1 user thanked author for this post.
    #235989

    Thx to ur help dear Roberto, but don’t sure the code work because on ProBacktest not give me datas.

    Hope u can help me to understand why. Best regards

    #236000

    Check that your timeframe is <= 5 minutes, as the candle involved must close on the minute (in your case 00 ans 05) used in the code.

     

    #236029

    hi Roberto, i’ve test with 1 minutes timeframe and others and have same thing like above (no datas on many years of graphic) .   That work on your prorealtime ?

    #236033

    It depends on the variable LotSize, I changed it so that it cannot fall below 0.5 lots (if it still doesn’t work try 1, instead of 0.5):

    #236370

    Thanks Roberto but I’m sorry I tried everything with my meager knowledge and nothing works. I haven’t data with the code :s

    #236371

    With this line 16, it works on all assets/instruments (using both 1-minute and 5-minute TFs):

     

    #236496

    Hi Roberto, i’ve send u an email on your personal website, have u receive it ?

    #236497

    Yes, it works like a charm.

     

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

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