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 AlessioCianini12, Today, 01:55 PM
      0 responses
      2 views
      0 likes
      Last Post AlessioCianini12  
      Started by rajneesh.sehgal, Today, 12:06 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by mo_fi, 01-21-2021, 10:08 PM
      22 responses
      1,313 views
      0 likes
      Last Post Wessel
      by Wessel
       
      Started by ezrollin, 01-12-2022, 03:43 PM
      2 responses
      36 views
      0 likes
      Last Post iq200
      by iq200
       
      Started by Red_70, Today, 11:07 AM
      3 responses
      16 views
      0 likes
      Last Post Red_70
      by Red_70
       
      Working...
      X