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

More than 1 Active Position

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

    More than 1 Active Position

    My strategy takes a while to take profit because of the conditions that has to be met. But I want to continue to enter into trades if the conditions are correct, a max of 3 open positions.

    Right now the strategy wont take any trades until the first trade's condition is met.

    I tried to change "Entries per direction" to 3 but all that did was enter 3 positions on the first time that conditions were met.
    "Entry handling" is currently on All Entries.

    Help?

    Thanks!

    #2
    Hello Ousher,

    Thanks for your post.

    If I understand correctly, you are saying that with entries per direction set to 3 that on the first entry condition, it places 3 orders and your expectation is that it would place 1 order and then sometime later if the same conditions are true again place a 2nd and then again a 3rd order?

    Are the 3 entries currently being made on the same bar?

    What is the Calculate setting used? (Calculate.OnBarClose, Calculate.OnPriceChange, or Calculate.OnEachTick).

    Are you testing on live data, historical data on the chart, historical data on the strategy analyzer, or playback with market replay data?

    Does your script access additional data series? (if so please identify)

    Are you using the Strategy Builder or the Ninjascript editor?

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello Ousher,

      Thanks for your post.

      If I understand correctly, you are saying that with entries per direction set to 3 that on the first entry condition, it places 3 orders and your expectation is that it would place 1 order and then sometime later if the same conditions are true again place a 2nd and then again a 3rd order?

      Are the 3 entries currently being made on the same bar?

      What is the Calculate setting used? (Calculate.OnBarClose, Calculate.OnPriceChange, or Calculate.OnEachTick).

      Are you testing on live data, historical data on the chart, historical data on the strategy analyzer, or playback with market replay data?

      Does your script access additional data series? (if so please identify)

      Are you using the Strategy Builder or the Ninjascript editor?
      Yes, that is my expectations.

      Yes, currently the 3 entries are happening on the same bar, should only be 1 entry for the bar.
      I am currently on OnPriceChange, testing on Playback with market replay.
      No additional data series
      And doing it through Strategy Builder.

      EDIT: Now that I'm looking at it, because im doing intra-bar calculations, seems like my conditions are being met more than once on the bar. Would a solution be to use Bars since entry?
      Last edited by Ousher; 12-02-2020, 09:59 AM.

      Comment


        #4
        Hello Ousher,

        Thanks for your reply.

        Correct, because of the OnPriceChange setting, your entry conditions are true multiple times in a bar.

        You can limit the entry to once per bar by creating an int variable and call it EntryBar. In your entry set add a check to see if the EntryBar is NOT equal to the Misc>Current bar, so when that is true along with your other conditions the first order is placed. In the action of that set add the action to set EntryBar to Misc>Current bar This will set the entry condition false after the first order and it will not be true again until you are in a new bar and your other entry conditions are also true again.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by MarianApalaghiei, Today, 10:49 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by love2code2trade, Yesterday, 01:45 PM
        4 responses
        28 views
        0 likes
        Last Post love2code2trade  
        Started by funk10101, Today, 09:43 PM
        0 responses
        8 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        46 views
        0 likes
        Last Post bill2023  
        Working...
        X