Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wait on flat-historical order error?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Wait on flat-historical order error?

    I run two strategy both long and short same time and want to manage two seperate strategy same time. Each strategy should work with their own set up. If a strategy green ready to take position on ''wait on flat'' there is no issue two manage both strategy.

    But if ''wait on flat' yellow and waiting to close position of previous entry; when it turned yellow to green and submiting close position of current opened position,I am getting modify historical order error and strategy disable itself.

    If i choose '' immediate submit', as far as i know strategy opening position on start and turn green from yellow, but not sending this order to account, right? If this is the case, what happens when this position close on strategy. This close position send to order to account? That means i am submiting close order to non-exist position and account will have position?

    If i choose '' immediate submit and sync.'' option when strategy starts, it turns green. But same time it syncronize the account and sending the order to account.
    Lets say for ''long strategy'' i started ''immediade submit and sync'', and sended long order to account. But what if, if i have short position on account on that time from my other short strategy''. Account position -1 from short strategy. When long send ''immediate submit sync'' order, Does account flat (-1+1), or it sends 2 long order ( first one to close short, another one to get long position (-1+2=1 Long)

    I am trying to figure out how can i handle this historical order error and disable issue?

    #2
    Hi Murphy67, thanks for writing in. We recommend not running two strategies on the same instrument because there's always a possibility that one can cause the other to go out of sync. Theres no way for a strategy to communicate with another strategy. You should combine the two strategies into one so it handles long and short orders as seen in the SampleMACrossover. To ignore all historical data, add this to the top of OnBarUpdate:

    if(State == State.Historical)
    return;

    And set the startup behavior to "Immediately Submit".

    Kind regards,
    -ChrisL

    Comment


      #3
      If i choose '' immediate submit', as far as i know strategy opening position on start and turn green from yellow, but not sending this order to account, right? If this is the case, what happens when this position close on strategy. This close position send to order to account? That means i am submiting close order to non-exist position and account will have position?

      Comment


        #4
        Hi Murphy67, using Immediately Submit will cause the strategy to be in the green (ready to trade) state as soon as it starts up. It will not wait for the account the flat from the virtual position once the next signal is seen in real time. If you do not ignore the historical data this could cause it to create an order that you do not want on the account, so that is why the historical data should be ignored in this case.

        Comment


          #5
          Hi Chris, thank you its clear.

          another scnerio;

          Lets say my account have short position. And, i run ''long strategy'' with ''immediade submit and sync'', and sended long order to account.
          Account position ''-1'' on start before ''immediate submit and sync'' for long order.. When long send ''immediate submit sync'' order, Does account flat (-1+1), or it sends 2 long order ( first one to close short, another one to get long position (-1+2=1 Long)

          Comment


            #6
            Hi Murphy67, If you have a short position on the account and you start the strategy and it submits a long order to synchronize it will cause the account to be flat. An account can not be long and short at the same time, so the buy synchronize order will close out the existing short position.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            77 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            45 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            27 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            32 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            63 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X