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 GussJ, 03-04-2020, 03:11 PM
            16 responses
            3,281 views
            0 likes
            Last Post Leafcutter  
            Started by WHICKED, Today, 12:45 PM
            2 responses
            19 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Started by Tim-c, Today, 02:10 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Taddypole, Today, 02:47 PM
            0 responses
            5 views
            0 likes
            Last Post Taddypole  
            Started by chbruno, 04-24-2024, 04:10 PM
            4 responses
            53 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Working...
            X