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

Simple conversion from NT7 does not work

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

    Simple conversion from NT7 does not work

    A simple indicator shows completely different values on NT7 and NT8

    Where did I go wrong?

    Click image for larger version

Name:	test1.png
Views:	257
Size:	148.1 KB
ID:	1164609

    [ATTACH]n1164607[/ATTACH]

    [ATTACH]n1164608[/ATTACH]

    #2
    Hello newbe17,

    The NinjaTrader 7 chart is 3 second 03-21 chart the NinjaTrader 8 chart is a 1 minute 09-21 chart. Different data will produce different results.

    Further, in NinjaTrader 7 when no value is set, the close price is used instead which can change the calculations. In NinjaTrader 8 when no value is set a 0 is returned.

    Use prints to understand the behavior. Print the time and print all values used for the calculations being set to that plot.
    For example where DownTrend is set:
    Code:
    DownTrend[0]=Low[0]-TickSize;
    Print(string.Format("{0} | Low[0]: {1}, TickSize: {2}, Low[0]-TickSize: {3}", Time[0], Low[0], TickSize, Low[0]-TickSize));
    Below is a link to a forum post that demonstrates using prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello newbe17,

      Further, in NinjaTrader 7 when no value is set, the close price is used instead which can change the calculations. In NinjaTrader 8 when no value is set a 0 is returned.
      Then how do I get the same values in NT8 as in NT7?

      Code:
      if (DownTrend.IsValidDataPoint(1))
      _trend[0]=(Close[0] > DownTrend[1]);
      else
      _trend[0]=(Close[0] > Close[1]);
      Last edited by newbe17; 07-21-2021, 04:52 PM.

      Comment


        #4
        Hello newbe17,

        Start by using prints to confirm what is causing differences. Print the time of the bar and all values involved with that plot. Address the value that is different.

        Use <Series>.IsValidDataPoint() to check if a value has been set, and choose what value to use when no value is set.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        16 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        5 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,407 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Working...
        X