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

Stop Loss value

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

    Stop Loss value

    Hi,
    Due to an error in the implementation on my strategy I am looking a very strange calculation of the Stop Loss.
    I have the next code for the protection:

    SetStopLoss(CalculationMode.Currency, SL);

    In the current implementation the value of SL goes negative, so it is working as a profit target.
    What I do not understand is how the value is set.
    In the image attached you can see the information of the candle where the code of the order and SL are launched (green candle at 15:00:00).
    At this candle, I printed the value of SL, being this -16250,41.
    The calculation mode is Currency, and the instrument is NQ, so I understand that the protection should be of 16250/20 = 812$, however the trade has a profit of 45$.

    What am I misunderstanding?

    #2
    Hello jemoce,

    Thank you for the post.

    The Currency calculation mode allows you to input a PnL dollar amount relative to your average entry. If you wanted a $20 max loss stop loss, then you would enter 20 as the value parameter. In an instrument like the NQ, for example, where each tick is worth $5, a stop will be placed 4 ticks against your average entry price. This will allows for up to $20 to be lost in the trade.

    The stop loss in the trade you posted looks like it was named incorrectly. If that was a short trade, then the profit target should have been the price hit, not the stop loss. I would need to test your code to look into the matter further. Please Export the strategy, then if you don't mind posting it here you may, or you may email it to platformsupport[at]ninjatrader[dot]com, referencing "ATTN ChrisL" in the body of the email.

    I look forward to your reply.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Philippe56140, Today, 02:35 PM
    0 responses
    2 views
    0 likes
    Last Post Philippe56140  
    Started by 00nevest, Today, 02:27 PM
    0 responses
    1 view
    0 likes
    Last Post 00nevest  
    Started by Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Started by Fitspressorest, Today, 01:38 PM
    0 responses
    2 views
    0 likes
    Last Post Fitspressorest  
    Started by Jonker, Today, 01:19 PM
    0 responses
    2 views
    0 likes
    Last Post Jonker
    by Jonker
     
    Working...
    X