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

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

    Stop loss

    Hello, the current indicator I am using has a stop loss value that is constantly changing. I have included images showing the data box, the signal shows (0.00) for a stop loss (dotted blue line) and has the price of stop loss. I assume this is the signal plot and can do in the strategy builder, ifsignal=0 then exitlong. If a buy long signal such as 2 is shown anytime on the chart I can do ifsignal=2, enterlong (these are simplified conditions just to show my point)

    So if 2 signal= enterlong
    If 0 signal= exit long

    But, this does not work and I cannot figure out why. Any ideas would be very much appreciated. Thank you
    Attached Files

    #2
    Hello Brandon9821,

    Thank you for your post.

    If 'Signal' is a plot in the indicator you are using then this indicator plot could be used to set up conditions in the Strategy Builder. See the help guide documentation below regarding making indicator-to-value comparisons in the Strategy Builder.

    Indicator to Value Comparison - https://ninjatrader.com/support/help...lueComparisons

    If the expected trade(s) are not appearing, this would indicate that the condition to place the order is not evaluating as true or the order is being ignored for other reasons.

    To understand why the script is behaving as it is, such as placing orders or not placing orders when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

    In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

    Below is a link to a forum post that demonstrates using prints to understand behavior and including a link to a video recorded using the Strategy Builder.
    https://ninjatrader.com/support/foru...121#post791121

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by mmenigma, Today, 02:22 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by frankthearm, Today, 09:08 AM
    9 responses
    35 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by NRITV, Today, 01:15 PM
    2 responses
    9 views
    0 likes
    Last Post NRITV
    by NRITV
     
    Started by maybeimnotrader, Yesterday, 05:46 PM
    5 responses
    26 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by quantismo, Yesterday, 05:13 PM
    2 responses
    21 views
    0 likes
    Last Post quantismo  
    Working...
    X