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

How to reference Parabolic SAR Stop price

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

    How to reference Parabolic SAR Stop price

    How can the Ninjatrader Parabolic SAR stop price (not the Parabolic SAR indicator) be referenced in a strategy. I would like to store the current Parabolic Stop price as a double once an order entry has been filled and then plot it -but using GetRealtimeOrder does not seem to work and I don't see any support for the Parabolic SAR Stop in the Order object guide here: https://ninjatrader.com/support/help...ount_class.htm . A simple example would be very much appreciated. Thanks!

    #2
    Hello quantera,

    Thank you for the post.

    You could use the order update events to track the order and collect its prices for this. The GetRealtimeOrder method would not be related to tracking an orders price specifically, this is to transition a historical order into realtime. This method also assumes you already have an order object you need to transition.

    Here is a simple example of an entry and printing the price of the stop as it changes:

    Code:
    protected override void OnBarUpdate()
    {
        if (CrossAbove(SMA(12), SMA(23), 1))
            EnterLong("MyLongEntry");
    }
    
    protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
    {
        if(order != null)
        {
            if(order.Name == "Parabolic stop")
            {
                Print(order.StopPrice);
            }
        }
    
    }
    https://ninjatrader.com/support/help...=onorderupdate

    You could store the price from here, or plot it however you see fit. The important note is using the orders name to find the specific order event which is the stop. This concept applies to all of the Set methods like SetProfitTarget or StopLoss where a signal name may not be given to the target.

    For a more complete example of using this override and OnExecutionUpdate please see the following guide: https://ninjatrader.com/support/help...=onorderupdate



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by frankthearm, Yesterday, 09:08 AM
    14 responses
    47 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by gentlebenthebear, Today, 01:30 AM
    2 responses
    13 views
    0 likes
    Last Post gentlebenthebear  
    Started by Kaledus, Today, 01:29 PM
    2 responses
    8 views
    0 likes
    Last Post Kaledus
    by Kaledus
     
    Started by PaulMohn, Today, 12:36 PM
    2 responses
    16 views
    0 likes
    Last Post PaulMohn  
    Started by Conceptzx, 10-11-2022, 06:38 AM
    2 responses
    56 views
    0 likes
    Last Post PhillT
    by PhillT
     
    Working...
    X