Announcement

Collapse
No announcement yet.

10 Hour RTH SMA on 5 Min Chart

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

  • 10 Hour RTH SMA on 5 Min Chart

    I am using the following code to calculate the 10 Hour RTH Simple MA on 5 Min chart, however the data that it returns is not correct. Is there something I am doing wrong or it is not possible to do so?

    function CalcMA60RTH()
    {

    vSMA60MinRTH=sma(10,inv("ES #F=2, 60"));

    }

    Thanks

    Tony G.
    Tony Gof

  • #2
    Tony
    You need to use sym() instead of inv() if you are passing a symbol or symbol and interval
    Alex


    Originally posted by Behzadgof
    I am using the following code to calculate the 10 Hour RTH Simple MA on 5 Min chart, however the data that it returns is not correct. Is there something I am doing wrong or it is not possible to do so?

    function CalcMA60RTH()
    {

    vSMA60MinRTH=sma(10,inv("ES #F=2, 60"));

    }

    Thanks

    Tony G.

    Comment


    • #3
      Thanks, I was using sym origialy but it gave me an error, then I switched to inv and it gave me an incorrect value. I had a space after the ',' do you think that would have caused it?

      sym("ES #F=2,60")

      thanks for your help

      Ben g.
      Tony Gof

      Comment


      • #4
        Tony
        I don't think that was the cause of the error. In the enclosed screenshot you can see that test sma.efs is returning the correct values even when adding a couple of spaces after the comma separator in the sym() function
        Alex

        Comment


        • #5
          I am not sure why that was the case, however it is all working, thanks again.


          Ben G.
          Tony Gof

          Comment


          • #6
            Ben
            You are most welcome
            Alex

            Comment

            Working...
            X