Custom Study pauses or stops


Category:
0
0

I have a custom study with simple 4 to 5 lines which references standard studies. My custom study stops plotting after 2 to 3 minutes on the chart.  Below is the code:

def LONG_BUY = 

(close is greater than MovAvgExponential(“price” = HIGH, “length” = 12).”AvgExp” and close from 1 bars ago is less than MovAvgExponential(“price” = HIGH, “length” = 12).”AvgExp”

and DMA(“length” = 15) is greater than DMA(“length” = 15) from 1 bars ago 

and DMA(“length” = 15) from 4 bars ago is greater than DMA(“length” = 15) from 5 bars ago) ;

I plugged the above in ‘conditional’ buy order and even that does not trigger. It triggers only if the condition staisfies within 2 minutes of wait and if thie wait is more than 2 to 3 minutes to satify the condition, then it never triggers at all.

 

What could be going wrong?

Marked as spam
Posted by (Questions: 3, Answers: 2)
Asked on February 5, 2020 9:57 pm
42 views
0
Private answer

I have no idea why this would stop working after a period of time. There is nothing in the code that references a higher time frame, which has been known to cause issues. The only error I find in your code is in the following section:

close from 1 bars ago is less than MovAvgExponential(“price” = HIGH, “length” = 12).”AvgExp”

If you are referencing the close "from 1 bars ago" you should also reference the moving average "from 1 bars ago". Like so:

close from 1 bars ago is less than MovAvgExponential(“price” = HIGH, “length” = 12).”AvgExp” from 1 bars ago

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on February 6, 2020 9:24 am
0
Private answer

I have found the reason for this. This is because of DMA study. Since this is has a "displace" inbuilt in the call.

So bascially anything not just DMA which has a "displace" based logic will not work.

Marked as spam
Posted by (Questions: 3, Answers: 2)
Answered on February 10, 2020 12:41 pm