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

    Hi

    is there a simple wait to say "set a stop loss 2 ticks below the low[0]"

    i'm trying the setstoploss action but this is only a calculationmode tick, price or currency

    if i use exitlongstop it is cancel at the end of the bar and i need to use the live until cancelled with the iorder and the canceloder(), so complicated for me...

    why it is not possible to say SetStopLoss("buy", StopLoss, true)
    with:
    "buy" to tie to the entrylong order
    private int StopLoss=Low[0]-1*TickSize;
    true for the simulated

    if i write this script it is not working... and it would be easier...

    Thomas

    #2
    Originally posted by Thomas79 View Post
    Hi

    is there a simple wait to say "set a stop loss 2 ticks below the low[0]"

    i'm trying the setstoploss action but this is only a calculationmode tick, price or currency

    if i use exitlongstop it is cancel at the end of the bar and i need to use the live until cancelled with the iorder and the canceloder(), so complicated for me...

    why it is not possible to say SetStopLoss("buy", StopLoss, true)
    with:
    "buy" to tie to the entrylong order
    private int StopLoss=Low[0]-1*TickSize;
    true for the simulated

    if i write this script it is not working... and it would be easier...

    Thomas
    Code:
    SetStopLoss("strSignalName", CalculationMode.Price, Low[0] - 2 * TickSize, true);

    Comment


      #3
      Thx a lot Koganam... it is working now !

      but just a question,

      what is the difference between setstoploss and exitlongstoplimit ?

      Thomas

      Comment


        #4
        Originally posted by Thomas79 View Post
        Thx a lot Koganam... it is working now !

        but just a question,

        what is the difference between setstoploss and exitlongstoplimit ?

        Thomas
        • SetStopLoss() is submitted as a market order.
        • SetStopLoss() price value is inherited. That is why it must be reset when the position goes flat.
        • ExitStopLongLimit() is submitted against a filled existing position; SetStopLoss() is set up before the order to enter a position.

        Those are the major differences that I can think of. There a probably a few others.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by inanazsocial, Today, 01:15 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by rocketman7, Today, 02:12 AM
        0 responses
        6 views
        0 likes
        Last Post rocketman7  
        Started by dustydbayer, Today, 01:59 AM
        0 responses
        1 view
        0 likes
        Last Post dustydbayer  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        23 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Working...
        X