multiple scripts in parallel execution, trading once per script

Forums ProRealTime English forum ProOrder support multiple scripts in parallel execution, trading once per script

Viewing 5 posts - 1 through 5 (of 5 total)
  • #150175

    Hi everyone, I was tried differents solutions posted in the forum, but none works in this context.

    I have 2 strategy scripts, script 1 running for ticket AAA, and script 2 running for ticket BBB (both in timeframe 1 second).

    I need these scripts running at the same time and with the restriction of only one trading for script, so in this context will have 2 trading as max.

    First try: using the reserved word ONCE but the script never starts.

    Second try, using the solution posted by Nicolas (https://www.prorealcode.com/topic/only-open-1-trade/), instead of 10, using 8*60*60 (8h x 60 sec x 60 sec)

    But the problem with this approach is that if script 1 launchs the operation first, script 2 never start in the same day.

    I also try to get the Date, and other feasible variables, but with the same result.

    Thanks in advance, for any suggestion.

     

    #150181

    Replace line 1 with these lines (sometimes ONCE behaves weirdly):

     

     

    1 user thanked author for this post.
    #150184

    Roberto, thanks a lot for the fast answer !

    So, with this implementation I suppose that both scripts may stay on market at the same time, isn’t? Because OnMarket it’s true only in the scope of the script, and not return a global position of other scripts.

    Tonight I will try your solution. Thank you very much !!

    #150197

    Yes, separate strategies are indipendent of one another. Each one of them doesn’t know about the existance of the others, even if on the same instrument and TF. They can even open positions in different directions.

     

    #150320

    Tested and it works fine !!

    Thank you very much for your help.

    Have a good day !

    1 user thanked author for this post.
Viewing 5 posts - 1 through 5 (of 5 total)

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