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 Unique Open Positions

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

    Multiple Unique Open Positions

    I have a strategy that has two unique entry signals. I would like to be able to have the second unique signal open a position while the first one is open, but only allow one open position at a time for each unique signal. I think I'm missing something though, because setting the parameters below, NT will only allow one open position at a time, or it will allow two positions open at a time, but they are not only unique positions, it allows each signal to be open twice. What am I missing?

    2 lines below results in 2 overlapping positions, but those positions can be from the same entry signal
    EntryHandling = EntryHandling.AllEntries;
    EntriesPerDirection = 2;

    2 lines below results in only 1 open position at a time
    EntryHandling = EntryHandling.AllEntries;
    EntriesPerDirection = 1;

    #2
    Hello Safetrader,

    An account/Instrument has a single "position" which can have any quantity in a direction Long or Short. In your strategy you can enter into the same direction multiple times depending on the EntryHandling setting and also the way that the entries are coded using unique names.

    If you wanted to make unique entries/exits to scale in or out you would need to use unique signal names in that case. The EntryHandling could be either setting, if you use AllEntries then you need to specify the correct amount of entries you wanted in the same direction.

    When you make the actions to enter the position each entry should have a unique signal name.

    Any exits you make should reference the unique entry signal name as its From Entry Signal property.

    Any targets you make should reference the unique entry signal name as its From Entry Signal property..

    You can find a sample which uses multiple entries to make a multiple quantity position and then scale out here: https://ninjatrader.com/support/help...a_position.htm

    As long as you tie an entry and exit together using the entries signal name you can scale in/out of an overall position using unique entries/exits.


    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for your quick response. I found the problem. I had everything correct, but when backtesting in the Stragety Analyzer I didn't realize it was overriding the "Unique entries" in my code and that I had to select that in the backtester, every thing is great now. Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by agclub, 04-21-2024, 08:57 PM
      4 responses
      18 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by Irukandji, Today, 04:58 AM
      0 responses
      2 views
      0 likes
      Last Post Irukandji  
      Started by fitspressoburnfat, Today, 04:25 AM
      0 responses
      2 views
      0 likes
      Last Post fitspressoburnfat  
      Started by Skifree, Today, 03:41 AM
      1 response
      4 views
      0 likes
      Last Post Skifree
      by Skifree
       
      Started by usazencort, Today, 01:16 AM
      0 responses
      1 view
      0 likes
      Last Post usazencort  
      Working...
      X