Announcement

Collapse
No announcement yet.

INV("D") returns null on 5M except for first candle

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

  • INV("D") returns null on 5M except for first candle

    Hi,

    I am having a specific problem with INV. To make it simple, I will put it this way. My chart interval is 5 min and I fetch last 5 days high low values for every new 5min candle that forms using
    lasthigh1 = high(-1, inv("D"));
    lasthigh2 = high(-2, inv("D")); .. and so on.

    I get the right values for lasthigh1 and lasthigh2 when first 5M candle of the day closes and new tick arrives for next 5M. Thereafter, for every new 5M candle tick , i get null for lasthigh1 and lasthigh2. I am calling those exact two lines for every new 5M candle. I tried backtesting and got the same, even on live charts.

    Any idea what is wrong with inv("D") for subsequent candles on smaller timeframe?

    My esignal version is 10.6.2425.1208

    Thanks.
    Last edited by gansal; 02-09-2012, 06:02 AM.

  • #2
    You need to post a sample script. It's not the function call in and of itself that's tripping you up.

    Comment


    • #3
      Re: INV("D&quot returns null on 5M except for first candle

      gansal
      The call is working fine in 10.6 as you can see in the enclosed screenshot in which the real time plotting of the chart started at the red vertical line [ie at 9:05 EST]
      The issue is likely elsewhere in your code so you may want to post a complete code example that illustrates what you are seeing
      Alex




      Originally posted by gansal
      Hi,

      I am having a specific problem with INV. To make it simple, I will put it this way. My chart interval is 5 min and I fetch last 5 days high low values for every new 5min candle that forms using
      lasthigh1 = high(-1, inv("D"));
      lasthigh2 = high(-2, inv("D")); .. and so on.

      I get the right values for lasthigh1 and lasthigh2 when first 5M candle of the day closes and new tick arrives for next 5M. Thereafter, for every new 5M candle tick , i get null for lasthigh1 and lasthigh2. I am calling those exact two lines for every new 5M candle. I tried backtesting and got the same, even on live charts.

      Any idea what is wrong with inv("D") for subsequent candles on smaller timeframe?

      My esignal version is 10.6.2425.1208

      Thanks.

      Comment


      • #4
        Yes. I wrote a small script for you guys, and then realized the problem was with initialzation of D on 5M chart and also with the flow in my script when I called the function to get last 5D high low on random 5M candle.
        Since D chart was being loaded on 5M, it returned null on first call. I fixed the issue by making a dummy call to inv("D") before calling the actual functions.

        Thank you so much guys. You actually helped me fix the problem.
        Thanks you again and have a rocking trading day ahead.

        Comment

        Working...
        X