• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hacked Indicator Not Working Real Time

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

    Hacked Indicator Not Working Real Time

    I am not a NinjaScript or C# programmer. I hacked up the publically available MASlopeBoxMulti to try and replicate another indicator I use. Although my formula seems to be basically correct in that it displays what I want on all bars except the current two bars, it really does not help me unless I can get it to work on the current bar. Could somebody take a look at the code and provide some guidance as to what I need to learn in order to get it running properly?
    Thank you,
    Scott

    STSlopeBox.zip

    #2
    Hello Scott,
    Thanks for your post.

    When I attached this indicator to my chart it plotted as I expected it to. What do you mean specifically by
    seems to be basically correct in that it displays what I want on all bars except the current two bars
    Can you provide a screenshot?
    JoshNinjaTrader Customer Service

    Comment


      #3
      Josh,
      The lower right box is the STSlopeBox. The lower left box is my original indicator. You can see at the right edge (real time), and back one bar, the value does not match. Once I go back two bars or further they agree perfectly. I am not sure if it is the EMA calculation on the last two bars or the Slope calculation that is using the wrong values. What is different about the bars in history vs. the right edge?
      Thanks,
      Scott
      Click image for larger version

Name:	STSlopeBox_Image.jpg
Views:	1
Size:	104.6 KB
ID:	1045555

      Comment


        #4
        Scott,

        I would not expect for this to have anything to do with historical vs real-time data. This is happening because of the way this scripts logic was written, but nothing jumps out as the obvious issue. In these situations I would recommend reducing the code down to make it easier to analyzer.

        If you reduce the code down to just the lines that are producing the slope values we can print those lines and figure out why they are different.
        JoshNinjaTrader Customer Service

        Comment


          #5
          Thanks Josh. When I try to clean up the code I keep breaking it. I guess I will have to pay someone to clean it up and fix it for me.

          Comment


            #6
            from your pictures you can see the slope angle is steady until you look at the Three Bars pic. here you see the MA line becomes more horizontal as you go back three bars. Looks like it is working ok.
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #7
              eDanny,
              I do not understand what you are saying. On my excel spreadsheet the values match all the way to the right edge whereas obviously the indicator does not. I think Josh is correct that the indicator logic is just off a little from what I need. Since I am using a static EMA I need to figure out how to remove the variable from my formula but I keep breaking the code.
              Scott

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by manugarc, Today, 01:15 PM
              0 responses
              6 views
              0 likes
              Last Post manugarc  
              Started by JMont1, Today, 11:42 AM
              0 responses
              4 views
              0 likes
              Last Post JMont1
              by JMont1
               
              Started by Steve L, Yesterday, 10:04 PM
              0 responses
              4 views
              0 likes
              Last Post Steve L
              by Steve L
               
              Started by marianfed, Yesterday, 09:47 PM
              0 responses
              5 views
              0 likes
              Last Post marianfed  
              Started by hir04068, Yesterday, 09:29 PM
              0 responses
              8 views
              0 likes
              Last Post hir04068  
              Working...
              X