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

TS Super Trend / Out of Sync / Too Many Entries

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

    TS Super Trend / Out of Sync / Too Many Entries

    I made a very simple TS Super Trend strategy that reverses when there is a change from uptrend to downtrend, and has a set stop loss. It back test well but when I run it live it keeps getting out of sync and taking more positions than it is suppose to. Can anyone help me figure out what the problem is? (I am not a coder).
    Attached Files
    Last edited by NinjaTrader_Jesse; 03-16-2021, 12:42 PM. Reason: dll in file not permitted

    #2
    Hello williamsjpw3,

    Based on the description it sounds like you may be seeing one of the normal differences from historical and realtime. Are you running the script OnEachTick or OnPriceChange in realtime? If so that would not match the historical tests which use OnBarClose so that would cause differences.

    Generally to answer this type of question would require that you debug the script to see why the conditions you made are happening differently between tests. A good way to approach that is to use Print(""); statements to output what the script is doing

    Have you at this point tried to use prints to see how your logic is run in each test?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      It is using on bar close. I have not tried prints. Do you have a guide for how to do that?

      Comment


        #4
        Hello williamsjpw3,

        If you are using the builder the print would be in the actions under the misc folder. You could use that to print when a condition is true to get a better idea of how frequently its happening. The output from that goes to the New -> NinjaScript output window.

        When using an indicator in your condition you may need to review what values the strategy is seeing to better understand why it is taking more/less trades than it should be. Outputting the values of the indicator by using a print is one way to do that.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Yesterday, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Yesterday, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Yesterday, 03:01 PM
        2 responses
        22 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Yesterday, 07:24 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X