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

SetStopLoss

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

    SetStopLoss

    How can you refer to the price of current stop loss in the function SetStopLoss so that you can check if you want to move it higher or lower?

    If (Close[0] < StopPrice)
    {
    SetStopLoss ( .......)
    }

    #2
    fiddy,

    You are able to store the stop loss price as a double then then call that double. Here's an example:

    double StopLossPrice = Position.AvgPrice - sl * TickSize;

    SetStopLoss(CalculationMode.Price, StopLossPrice);
    Bobby Y.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by 1001111, Today, 01:35 AM
    0 responses
    5 views
    0 likes
    Last Post 1001111
    by 1001111
     
    Started by ETFVoyageur, Yesterday, 07:05 PM
    1 response
    16 views
    0 likes
    Last Post ETFVoyageur  
    Started by MarianApalaghiei, Today, 12:35 AM
    1 response
    8 views
    0 likes
    Last Post MarianApalaghiei  
    Started by Rogers101, 05-05-2024, 11:30 AM
    17 responses
    57 views
    0 likes
    Last Post Rogers101  
    Started by haas88, 03-21-2024, 02:22 AM
    13 responses
    156 views
    0 likes
    Last Post haas88
    by haas88
     
    Working...
    X