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

Troubleshooting values of SMA

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

    Troubleshooting values of SMA

    Hi programmers,

    I have bugs in my indicator and using the print statement to troubleshoot. This is what I found:

    Print("First" + SMA(7)[0]);
    Print("Second" + SMA(20)[0]);

    all give out EXACTLY the same results in my output window and as we know, these values should be different.

    Thanks

    #2
    Hello BernWillChris,

    Thank you for your note. I am not able to reproduce this issue on my end. Can you please send your code as well as what instrument you are testing on and what data provider you are connected to? If you do not wish to post this information on the forums, please send an email to platformsupport[AT]ninjatrader[DOT]com and add this ticket number in the body of your email: #1354138

    Thank you in advance.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      Thanks for the reply,

      I'm using the instrument EUR/USD and FXCM feed(if that is what you asking for).

      The code is attached and commented too. It isn't too complex since I'm just getting started and testing things as I go.
      Attached Files
      Last edited by BernWillChris; 07-17-2015, 01:11 PM.

      Comment


        #4
        Hello BernWillChris,

        Here is an excerpt of the output window from when I run your indicator with an FXCM connection on $EURUSD:

        First1.08451428571429
        Second1.08455714285714
        First1.0845
        Second1.08455
        First1.08448571428572
        Second1.08453571428571
        First1.08447142857143
        Second1.08451428571428
        First1.08445714285715
        Second1.08449285714285
        First1.08444285714286
        Second1.08447857142857
        First1.08442857142857
        Second1.08447142857143

        These values are not the same and they line up with what I see when I add two SMA indicators to a EURUSD chart with respective periods of 7 and 20.

        Could you please take a screenshot of your output window where every SMA 7 value is the same as every SMA 20 value so I may investigate the issue further? Also please make sure when you open up a $EURUSD chart that it shows visible bars, indicating you have data loaded in the platform.

        Thank you in advance.
        Michael M.NinjaTrader Quality Assurance

        Comment


          #5
          OMG!! Silly me! I'm having one of those moments that I become blind to details...lol. Some of the values are so close that I have to scroll down further to see some with a greater and a more noticeable difference. Sorry to bring a problem this simple to the forum. I probably need to walk away until tomorrow.

          Thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by KenneGaray, Today, 03:48 AM
          0 responses
          3 views
          0 likes
          Last Post KenneGaray  
          Started by thanajo, 05-04-2021, 02:11 AM
          4 responses
          470 views
          0 likes
          Last Post tradingnasdaqprueba  
          Started by aa731, Today, 02:54 AM
          0 responses
          4 views
          0 likes
          Last Post aa731
          by aa731
           
          Started by Christopher_R, Today, 12:29 AM
          0 responses
          10 views
          0 likes
          Last Post Christopher_R  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          166 responses
          2,237 views
          0 likes
          Last Post sidlercom80  
          Working...
          X