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 GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,281 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Tim-c, Today, 02:10 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    53 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X