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 jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,290 views
    1 like
    Last Post jgualdronc  
    Started by Touch-Ups, Today, 10:36 AM
    0 responses
    9 views
    0 likes
    Last Post Touch-Ups  
    Started by geddyisodin, 04-25-2024, 05:20 AM
    11 responses
    62 views
    0 likes
    Last Post halgo_boulder  
    Started by Option Whisperer, Today, 09:55 AM
    0 responses
    8 views
    0 likes
    Last Post Option Whisperer  
    Started by halgo_boulder, 04-20-2024, 08:44 AM
    2 responses
    25 views
    0 likes
    Last Post halgo_boulder  
    Working...
    X