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 naanku, Today, 07:25 PM
        0 responses
        6 views
        0 likes
        Last Post naanku
        by naanku
         
        Started by milfocs, Today, 07:23 PM
        0 responses
        4 views
        0 likes
        Last Post milfocs
        by milfocs
         
        Started by PaulMohn, Today, 06:59 PM
        0 responses
        7 views
        0 likes
        Last Post PaulMohn  
        Started by bortz, 11-06-2023, 08:04 AM
        48 responses
        1,753 views
        0 likes
        Last Post carnitron  
        Started by Jonker, 04-27-2024, 01:19 PM
        3 responses
        24 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X