Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hypothetical Orders on Live Account Charts

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

    Hypothetical Orders on Live Account Charts

    I have had this conversation in the past with Ninja support, I am trying to wrap my brain around why the system enters Hypothetical trades on a live account chart, this keeps the system from entering what would otherwise be good "Live" trade setups, if I manually exit the trade, it stops the system and I have to re mount the system and then in some cases it enters another hypothetical trade and the cycle continues. The other problem I have is that when it exits it's hypothetical trade it goes out of sync and thinks its short if the hypothetical trade was long.

    My other option is to execute a trade from hypothetical results, which would be great if I was swing trading for 3 or four days, My average hold time is 15 minutes to an hour so entering a trade in the middle of a run is not an option for me, I need an option to turn it off! All I want to do is trade and I have to monkey around with this everyday.

    Am I doing something wrong here? and out of curiosity why is this even included as a feature on the platform, when I am ready to trade live I am not interested in seeing hypothetical trades on my charts, as far as I am concerned those trades need to close as soon as it hits the current bar during start up or they should be left for back testing.

    #2
    metal trader,

    There are several reasons why the options are available. Not everyone trades in the same fashion you trade and so that is why they are provided. Some people may hold account positions in relation to their historically calculated out strategy position.

    If you want it to not care about historical data you need to program your strategy to not care about it. Just add at the top of your OnBarUpdate() method

    Code:
    if (Historical)
         return;
    Depending on your settings you needed to sync your account position with your strategy position. You should review this article because the item discussed in there is exactly what you are facing: http://www.ninjatrader-support2.com/...ead.php?t=4033
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the Code tip,

      I read your link & I have read that before, I do not see where it shows me how to sync my strategy position to my account position, it has an example of how to sync my Account position to my Strategy position but I do not want to do that for my strategy.

      So if I use the code snip you gave me that should turn this off so that the system ignores all historical orders, correct?

      Comment


        #4
        You cannot sync your strategy position to account position. You can only manually sync your account position to the strategy position.

        With the snippet your strategy does not run any calculations based on historical bars and therefore would never have any strategy position. Start your account as flat with your strategy and it will be in sync from that point forward.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          "Start your account as flat with your strategy and it will be in sync from that point forward."

          That would work great if Ninja could run 24/7 but it's unrealistic, I have to reboot Ninja everyday, after every reboot I have to re-mount all of my systems again, with every remount comes a whole drove of hypothetical trades I have to get to flat so I can begin trading, but every time I take a hypothetical trade to flat, I have to remount the system.

          You recommended that I use the snippet of code, I am not sure I understand this clearly, if I use that snippet, every tick that passes becomes historical information therefore all trades would be ignored including live? or are you saying that during boot up, it would ignore all dated historical information and would start trading on current bars executing actual live trades? Do I have any other options for coding my strategy to ignore hypothetical orders?

          Comment


            #6
            metal trader,

            You may be misunderstanding the syncing procedure. You do not bring the strategy position to flat. You bring your account position up to match the strategy position. If you start a strategy and it has a long position. You buy long on your account to match it. Not vice versa. You do not attempt to close your strategy position to match a flat account state.

            Now the snippet I provide means it will not run your logic at all till it starts seeing real-time bars. All the old bars will not be calculated on. Once the chart starts having real-time data if you accessed Close[1] for the close price of the previous bar it would have no problem accessing that value. It is just it will not evaluate the old bars for historical execution.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hi Josh,

              Thanks for clearing that up, I understand the syncing procedure, It is just very important that I am understanding what you say in the manner of what you are thinking, I am not a programmer so every time I pick up the phone to call my programmer it cost me money and I have lost a lot of it from misunderstandings with your tech support team, so I am not trying to be annoying, just thorough...

              Comment


                #8
                metal trader,

                That is not a problem at all. Are we in unison now? Please also be aware of the selectable options you have in these syncing regards. Go to Tools->Options->Strategies->NinjaScript. You have "Wait until flat" and "Immediately submit live".

                "Wait until flat" means what it sounds like. The hypothetical strategy position will continue along its way and your strategy will continue making trades normally, but these trades will be simulated trades. The moment your strategy reaches a flat state or crosses the flat state then the next trade will be a live trade to your account. If you use this option you want to start your strategy after you have ensured your account position is flat.

                "Immediately submit live" is what you probably have selected. You start up your strategy and let us say it has a strategy position of long. The next trade it does is to close that long. Your strategy position will become flat, but because your account position was flat to begin with it is now short. You were out of sync. If you use this option you want to bring your account position up to sync with the strategy position upon starting. You needed to bring your account position to long when you started and that would bring the strategy and account in sync. Then the next trade, close the long position, will be a live trade and everything will work out.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by trilliantrader, 04-18-2024, 08:16 AM
                7 responses
                27 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by samish18, 04-17-2024, 08:57 AM
                17 responses
                64 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by rocketman7, Today, 02:12 AM
                2 responses
                18 views
                0 likes
                Last Post rocketman7  
                Started by briansaul, Today, 05:31 AM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by PaulMohn, Today, 03:49 AM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X