Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Error on Orders

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

    Error on Orders

    Hey guys I've got a major issue with my order code. I have two strategies and Friday I had one strategy submit a sell order at a stop level, but it also sold the shares from the other strategy even though they have different entry and exit names and conditions. How do I prevent this?

    Here is my order code for the sell:
    exitLong1a = ExitLong(25, "exitLong1a", "enterLong1a");

    Thanks,
    EliteTraderNYC

    #2
    EliteTraderNYC,

    Was this two different instruments that the strategy's were running on or just one?

    Additionally, were these on the same account?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Sir, they were both on the ES instrument on the SIM101 account.

      The two strategies had different stops, but when the first strategies stop was hit, it triggered both sells.

      Comment


        #4
        EliteTraderNYC,

        Strategy's will not know what another strategy is doing with its orders or positions. Therefore, any orders submitted can interfere with the Account's positions when there are two strategies working for the same instrument and account

        Example, two strategies -> one goes short and the other goes long. While the strategys will have their own working positions, one short and one long, the account will be considered flat at this state.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Hi sir, so are you saying that if you have the same strategy working on the same instrument would it be best to have different accounts for each strategy? I need the most efficient workaround to avoid this problem.

          Thanks

          Comment


            #6
            Hello elitetradernyc,

            That may be the most efficient way to do it yes, since it will require no addition code changing and an additional Sim account can be created easily in NinjaTrader by going to Tools -> Options -> Accounts.
            JCNinjaTrader Customer Service

            Comment


              #7
              Hi sir, is there another way to get around this problem? I currently do not have a realtime NT license so I dont think that I can create more than one sim account?

              Comment


                #8
                Hello elitetradernyc,

                There is not another way to get around this that I know of using live data.

                Note that this is due to a Strategies position being different than an Account Position which is why you are seeing this behavior. You may view the following thread that will give you an example of this in detail.


                Could you clarify what you are wanting to accomplish by placing two strategies on the same instrument? For example are you just trying to compare Strategy results with different parameters?

                Also, what instrument are you testing this on?
                JCNinjaTrader Customer Service

                Comment


                  #9
                  Hi, its for ES. I have different profitable strategies that I want to run on ES. I got a live license so im set now.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by pmachiraju, 11-01-2023, 04:46 AM
                  8 responses
                  149 views
                  0 likes
                  Last Post rehmans
                  by rehmans
                   
                  Started by mattbsea, Today, 05:44 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post mattbsea  
                  Started by RideMe, 04-07-2024, 04:54 PM
                  6 responses
                  33 views
                  0 likes
                  Last Post RideMe
                  by RideMe
                   
                  Started by tkaboris, Today, 05:13 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post tkaboris  
                  Started by GussJ, 03-04-2020, 03:11 PM
                  16 responses
                  3,283 views
                  0 likes
                  Last Post Leafcutter  
                  Working...
                  X