Announcement

Collapse
No announcement yet.

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.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    24 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    120 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X