Cumulate orders issue

Forums ProRealTime English forum ProOrder support Cumulate orders issue

  • This topic has 2 replies, 3 voices, and was last updated 3 days ago by avatarJS.
Viewing 3 posts - 1 through 3 (of 3 total)
  • #248951

    Hey everyone!

    This will be my first time engaging on this forum, Im new to the pro realtime platform but already benefiting from features (backtesting mainly).

    But.. I have ran in to a little bit of a snag, hoping someone can help me out. I’m trying to set a limit on cumulating orders for a strategy, but it’s not respecting my max count. Im sure I’m doing something wrong, I have minimal to no coding experience. Please see screen shot and let me know what you think, any help would be greatly appreciated.

    Thanks,

    Josh

    #248953

    When posting code, please use the text format, either pasting it as is or pasting it using the “insert PRT code” button. To copy it to the clipboard you can either select the text of the code to be copied manually or press the COPY icon highlighted in the attached screenshot X.

    The screenshot Y shows where you can find the “insert PRT code” button.

    Thanks 🙂

    There you go:

     

     

    1 user thanked author for this post.
    #248967
    JS

    Hi Josh, welcome…

    Here’s the code from your screenshot…

    The issue with your system not respecting the maximum position size lies in line 10 of your code…

    When the conditions c1 and c2 are true, a position is opened. However, these conditions can remain true for multiple bars (days), which causes the system to keep opening new positions as long as the conditions hold…

    The solution is to replace line 10 with the following condition:

    If NOT LongOnMarket and c1 and c2 then

    This ensures that a new position is only opened when no position is already active…

    2 users thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

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