• 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?
    Josh G.NinjaTrader 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:	19
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.
        Josh G.NinjaTrader 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


                #8
                Hey Scott by any chance have you ported the STSlopeBox to NT8 yet, if so can you share it.
                Thanks in adavnce.
                Cz

                Comment


                  #9
                  Originally posted by Scott_Mariani View Post
                  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

                  [ATTACH]n1045501[/ATTACH]
                  Scott,

                  The indicator employs a moving average to calculate the slope. As you move from one bar to another the slope value will change based on the value of the moving average.

                  In this case, it is likely that you may have the same MA value for the last 2 bars. You can confirm this by either printing the MA value, simply change to a different MA period than 13, or use a different instrument and see if you observe the same behavior.

                  The indicator seem to be behave as expected, no need to waste any of your money

                  Cheers!

                  Comment


                    #10
                    Aligator,
                    The Indicator was not working as intended. I paid a developer on Upwork and he was able to quickly correct the issue for me. My issue was "It was the wrong logic in OnPlot method. It was taking two bars that are closed and it didn't count the last forming bar."

                    zitroc,
                    Sorry, I only paid to get it working for NT7.

                    Scott

                    Comment


                      #11
                      Hmm well if you like to share on it here and I can have the NT7 version converted over to NT8 by my programmer and share here on the forum.
                      Thanks for the prompt response Scott!
                      Cz

                      Comment


                        #12
                        zitroc,
                        Here is the file. The Upwork developer did exactly what I asked which was to get the formula working correctly. If you would like to clean it up to add a box around the angle, select the color of the box, and select the corner to display the angle for NT7 that would be great.
                        Scott
                        Attached Files

                        Comment


                          #13
                          Scott I'll have my guy work on it and I'll keep you posted. Thanks!

                          Comment


                            #14
                            zitroc you are certainly welcome but I am curious why you are interested in this Indicator. I only wanted it so I had a way of moving to NT8 once I had to. The only reason I needed this Indicator was because it was unique and not part of the Multi options of the publically available SlopeBox Indicator. I have used this Indicator to establish and backtest my Breakout trade criteria and I just wanted to make sure I could continue to do so in the future, there is nothing special about this particular formula.
                            Good Trading,
                            Scott

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by EnveousColnago, Yesterday, 05:43 PM
                            4 responses
                            23 views
                            0 likes
                            Last Post marcus2300  
                            Started by Vypre, 11-23-2018, 07:51 AM
                            2 responses
                            42 views
                            1 like
                            Last Post fx.practic  
                            Started by offorsoll, Today, 04:19 AM
                            0 responses
                            2 views
                            0 likes
                            Last Post offorsoll  
                            Started by AMATX, Yesterday, 09:29 AM
                            7 responses
                            35 views
                            0 likes
                            Last Post AMATX
                            by AMATX
                             
                            Started by Johnny Santiago, Yesterday, 06:18 PM
                            1 response
                            8 views
                            0 likes
                            Last Post Johnny Santiago  
                            Working...
                            X