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

Strategy that only trails a stop

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

    Strategy that only trails a stop

    I am trying to create a strategy that is only used to trail a stop based on the ParabolicSAR. I am able to do this in a "full" strategy that enters positions and then trails the stop based on ParabolicSAR, so I know that part of the code works. My problem occurs in the strategy that will only trail the stop from a position that was entered manually. I can't seem to have the strategy get the correct atmstrategyId of the working orders and I'm unable to have it get the entry price. I have been using
    atmStrategyId = GetAtmStrategyUniqueId();
    which seems to get random ID's and
    if (GetAtmStrategyMarketPosition(atmStrategyId) != MarketPosition.Flat)
    entryPrice = GetAtmStrategyPositionAveragePrice(atmStrategyId);
    for the entry price which isn't working either.
    I'm wondering if this is even possible (getting the strategy ID from manually placed orders). Any help would be appreciated.

    Thank you

    #2
    Hello mlarocco,

    Thank you for your post.

    As you have guessed, this is unfortunately not possible with manual entries.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Ndakotan1313, 03-14-2024, 05:02 PM
    3 responses
    65 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by reynoldsn, Yesterday, 04:40 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by memonic, Yesterday, 01:23 PM
    4 responses
    27 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by BIOK.NT, Yesterday, 01:56 PM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by betsuni_123, Yesterday, 04:20 PM
    1 response
    18 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X