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

Values of stoploss

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

    Values of stoploss

    I use a managed SetStopLoss() that moves, how can I get the current value of the stoploss to draw on my chart?

    #2
    Hello gg80108,

    You may use the OnOrderUpdate() method to be able to get the Price of the Stop loss and print it on your screen. For example:

    Code:
     protected override void OnOrderUpdate(IOrder order)
            {
    			Print("Order Name: "+order.Name);
    			Print("Order StopPrice: "+order.StopPrice);
    			
    			if(order.Name == "Stop loss")
    			{
    				Print("Stop loss Order updated");
    				DrawTextFixed("test1", order.StopPrice.ToString(), TextPosition.TopRight);
    			}
         }
    Here is a link to our Help Guide that goes over OnOrderUpdate() that you may use as a reference.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by OllieFeraher, Today, 11:14 AM
    0 responses
    2 views
    0 likes
    Last Post OllieFeraher  
    Started by aman jain, 10-01-2020, 09:25 PM
    3 responses
    293 views
    0 likes
    Last Post Legiboka  
    Started by quicksandatl, Today, 11:11 AM
    0 responses
    3 views
    0 likes
    Last Post quicksandatl  
    Started by reynoldsn, Today, 07:23 AM
    5 responses
    12 views
    1 like
    Last Post NinjaTrader_Gaby  
    Started by pecunianonolet, 11-28-2016, 03:34 AM
    6 responses
    4,515 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X