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

entry is off after I add a trailing stop

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

    entry is off after I add a trailing stop

    Hello!

    I have built a strategy on the strategy builder that works on the MACD crossover.

    It enters when the MACD crosses over with another condition based on an EMA.

    The second I add a trailing stop loss it enters before the MACD crosses over and gets me in some losing situations since the MACD never crossed.

    Is this normal and how do I prevent this?

    #2
    Hello litamm89,

    Thank you for your post.

    If the expected trade(s) are appearing, this would indicate that the condition to place the order is evaluating as true.

    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

    Please let me know if I may further assist
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Stanfillirenfro, Today, 07:23 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    2 responses
    21 views
    0 likes
    Last Post cmtjoancolmenero  
    Started by olisav57, Yesterday, 07:39 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by cocoescala, 10-12-2018, 11:02 PM
    7 responses
    944 views
    0 likes
    Last Post Jquiroz1975  
    Started by oviejo, Today, 12:28 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X