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

Reference Point Dummy Entry

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

    Reference Point Dummy Entry

    I have been creating reference points for
    MarketPosition.Short and MarketPosition.Long
    that I could use later as a condition.
    It works for the most part except that instead of entering at the 0 position size,
    NT8 enters at 1 which I assume is the minimum.
    Is there any way to have those reference points of Long/Short
    without actually entering with the quantity of 1?

    Is there another way I could do something similar?

    Code:
    If (CrossBelow(SMA2, SMA1, 1))
    {
    EnterShort(0, 0,"DummyShort");
    }
    
    if (PositionAccount.Quantity >= 1)
    && (Position.MarketPosition == MarketPosition.Short)
    {
              EnterShort(0, Quantity,"RealShort");
    }

    #2
    Hello johnnybegoode,

    Thanks for your post.

    The MarketPosition of Long or short is only created when you have an entry order that has been filled.

    I suspect that you want to do is to create a bool variable (that can only be true or false) and use that as a reference point when a cross condition occurs. You can then use that bool in another set as part of a set of entry conditions. In that set then where you place the actual entry order, you could then set the bool to false to prevent further entry based on that crossover until the next crossover occurs.

    I may not have understood your objective so if my reply does not meet your needs, please post again perhaps with another example.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AaronKoRn, Today, 09:49 PM
    0 responses
    6 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Today, 08:42 PM
    0 responses
    9 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Today, 07:51 PM
    0 responses
    10 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,976 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Today, 06:48 PM
    0 responses
    9 views
    0 likes
    Last Post rbeckmann05  
    Working...
    X