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

Strategy works in Strategy Analyzer but not on realtime

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

    Strategy works in Strategy Analyzer but not on realtime

    Hi

    I wrote a script from NT7 to NT8, it is working well with the Strategy Analyzer AND on realtime on NT7 but on NT8 it is working only with the Strategy Analyzer but not on realtime AND on the market replay

    I read on the NT8 guide many things but i don't find the solution, here the begining of my script

    // </summary>
    protected override void OnBarUpdate()
    {

    if (BarsInProgress != 0)
    return;


    if (CurrentBar < 1)
    return;



    if (CurrentBar < BarsRequiredToTrade )
    return;

    {

    double pointbasmarche = MIN(Close,13)[5];
    double tendanceb = MIN(Close,5)[20];
    .....

    Can you help ?

    Thx


    #2
    Hello Thomas79,

    Thanks for your post.

    The Playback Connection can be used to mimic realtime data on NinjaTrader 8. (This is the same as the Market Replay Connection in NinjaTrader 7.)

    I would suggest setting up specific tests with the Playback Connection to focus on certain behaviors that you see happening in NinjaTrader 7 but not in NinjaTrader 8. Once the behaviors can be reproduced consistently, you will better be able to confirm the functionality and take debugging steps to see what is happening.

    While debugging you will want to ask yourself:

    1. Do I see any errors in the log tab of the Control Center?
    2. What specifically is not happening in my NinjaTrader 8 script that is happening in my NinjaTrader 7 script?
    3. When you add debugging prints, how are the conditions evaluating? If you see some action happening in NinjaTrader 7 that is not happening in NinjaTrader 8, the logic controlling that action will need to be checked. If the values which are used to evaluate the condition are different, how are those values calculated?

    Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm

    I would also test commenting sections of your code and testing to verify which sections are working, and which sections need attention.

    If you identify something specific that is behaving differently and would like our insight, please prepare a small example that demonstrates the issue alone. This test script should have other logic removed and only focus on the specific difference in behavior you are inquiring on. Scripts can be exported following the steps linked below. (As we are small team, we won't be able to break down the full code, but we are happy to share our insight on a small test case that presents a specific question.)

    Exporting - https://ninjatrader.com/support/help...tAsSourceFiles

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thx for the response

      I understand you're a small team and will not debbug my script.

      I just wonder how it is possible that the same script on NT7 works historically AND in live, on NT8 works historically BUT NOT in live. There is no bug on the logs and the script is enabling in realtime (turn green)...

      So, i'll try to do as you mentionned , step by step.

      Regards

      Comment


        #4
        Hello Thomas79,

        Any difference in behavior will have to be broken down to what specifically is not working the same way. Debugging steps will be a necessary step in the conversion process to see what the exact differences are as the script runs and places orders.

        If you have any specific questions taking these steps, please let us know.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        15 responses
        3,268 views
        0 likes
        Last Post xiinteractive  
        Started by Tim-c, Today, 02:10 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        2 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        50 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        10 responses
        401 views
        1 like
        Last Post beobast
        by beobast
         
        Working...
        X