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

Real time action and backtests dont line up

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

    Real time action and backtests dont line up

    Hello!

    I am testing a super basic strategy because I noticed some irregularities between some strategies.

    For simplicity sake lets say I am testing the RSI indicator when it crosses below the 70 and above the 30.

    There are no other entry conditions in the strategy builder other than RSI Cross below Numerical number 70 and another set for RSI cross above numerical number 30. It works perfectly fine during the backtest and you can see on the chart settings that it is entering and exiting correctly.

    However, when testing on live data. It only takes random crossovers above 30 and doesn't trigger any sell orders going below 70.

    Why is this and how can I fix this?



    #2
    Hi litamm89, thanks for writing in.

    The best way to see what your strategy is doing is to use the Print method to print out data from the strategy as it is running. e.g.

    if(<condition1> && <condition2>)

    {
    Print("Trade Condition Reached ");
    Print(<condition1>);
    Print(<condition2>);
    EnterLong(1);
    }

    If you are not seeing trade signals, the most probable cause is the condition is not being reached. Also, look at the Log tab of the Control Center for ignored trades as well. Ignored trades will happen if the strategy is breaking the managed approach order rules:
    https://ninjatrader.com/support/help...d_approach.htm

    kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_ChrisL


      I checked the log and there was nothing being ignored on that end.

      Im sorry not sure what you mean by print data.

      Could you walk me through how to do that?

      I do everything on strategy builder.

      Comment


        #4
        Hi litamm89, thanks for your reply.

        The Print method can be found under the Misc folder in the strategy builder. Use this to print out the same conditions being used to enter the trade. E.g.



        We also have a set of guides here on the condition builder that demonstrates various things you can do with the strategy builder:
        https://ninjatrader.com/support/help...on_builder.htm

        Kind regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          NinjaTrader_ChrisL

          My input looks a little different will this still work?

          What are the next steps to get you the print data?

          I attached a photo of my input. is it automatically supposed to say convert or did i input it incorrectly?

          Attached Files

          Comment


            #6
            Hi litamm89, thanks for your reply.

            That is printing out the string literal "RSI[0]" It needs to set the string as I showed in my first screen shot, Print>Message>Set>String 0>Set>Pick the indicator value you want to test. If you need to take a screen shot I recommend using TinyTake, they make it easy to share screenshot directly from your computer:
            TinyTake: Enhance your business with our platform for customer training, community engagement, and idea management. Streamline education, foster collaboration, and drive innovation.


            I highly recommend going through the tutorials in the help guide for practice with the strategy builder:
            https://ninjatrader.com/support/help...on_builder.htm

            The D3Spotter is also a popular script that can use the RSI:
            https://ninjatraderecosystem.com/use...d3spotterv3-2/

            Best regards,
            -ChrisL

            Please Note: The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              you have to open the ninja script output window in order to see the print output

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Pattontje, Yesterday, 02:10 PM
              2 responses
              32 views
              0 likes
              Last Post Pattontje  
              Started by abdo22, Yesterday, 03:15 PM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by f.saeidi, Yesterday, 02:09 PM
              3 responses
              20 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Jltarrau, Today, 05:57 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by kujista, Today, 06:23 AM
              0 responses
              2 views
              0 likes
              Last Post kujista
              by kujista
               
              Working...
              X