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

Multiple entries

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

    Multiple entries

    In my OnBarUpdate, I have said to EnterShort if (Position.MarketPosition == MarketPosition.Flat). However, i noticed in backtest that there are several entries made before it exits previous position. I toggled CalcualtionOnBarClose with true and false but no difference. I want only one entry at one time. Separately, I have the Backtest properties set to Entry per Direction = 1 but that does not seem to work either.

    #2
    What entry conditions are you using here? Toggling CalculateOnBarClose in backtesting would have zero effect, this is a realtime property only.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for quick reply. Did not think I would get a reply till next week.
      My primary bars are 15m. And in the condition I'm checking for when 1m price close bar crosses 15m PSAR. Does this help.
      So within the 15m bar there are several entries which I don't want. How can I restrict to only 1 entry at all time. Next entry only after first entry has exited.

      Comment


        #4
        ashish997,

        Let me go back to your first post. You mention you have EntriesPerDirection set to 1. What do you have EntryHandling set to? This should be AllEntries if you want it to only allow for 1 position at a time. Setting it to UniqueEntries means 1 position per signal name you provide. If you have 2 or 3 different signal names it would be possible to have 2 or 3 different short trades active.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          It was always set to Allentries. However, after you mentioned I tried both Allentries and UniqueEntries. But still no difference. For example i still have 5 entry trades between 930 - 945 on one stock I'm testing. They all exit at 945.

          Comment


            #6
            Then you will need to turn on TraceOrders = true and see what is happening under the hood with your trade logic and slowly step through it.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by trilliantrader, 04-18-2024, 08:16 AM
            5 responses
            22 views
            0 likes
            Last Post trilliantrader  
            Started by Davidtowleii, Today, 12:15 AM
            0 responses
            3 views
            0 likes
            Last Post Davidtowleii  
            Started by guillembm, Yesterday, 11:25 AM
            2 responses
            9 views
            0 likes
            Last Post guillembm  
            Started by junkone, 04-21-2024, 07:17 AM
            9 responses
            68 views
            0 likes
            Last Post jeronymite  
            Started by mgco4you, Yesterday, 09:46 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X