Page 1 of 1

MA ZigZag

PostPosted: Wed Mar 18, 2020 4:53 am
by Apprentice
USOil m1 (03-18-2020 0902).png

You can download Tick ZigZag here.
viewtopic.php?f=17&t=34791
MA ZigZag.lua
(11.91 KiB) Downloaded 301 times

Re: MA ZigZag

PostPosted: Wed Mar 18, 2020 5:57 am
by Gilles
Hi Apprentice,

Where is MA ZigZag ?

:)

Re: MA ZigZag

PostPosted: Thu Mar 19, 2020 4:19 am
by Apprentice
Fixed.

Re: MA ZigZag

PostPosted: Thu Mar 19, 2020 7:48 pm
by Gilles
Hi Apprentice,

I tried to choose the source of MA ZigZag with MA:getCandleOutPut(0) and it doesn't work. I have a mistake.
then MA:getStream(0) and even with MA:getStreamCount()-1.
In short, I can't create an error-free strategy.

can you make an example of a strategy to understand my mistake.

Example of rule:
if ZigZag[period] > MVA(12) (external indicator) = SELL
elseif ZigZag[period] < MVA (12)
(external indicator) = BUY
End

thenk you

Re: MA ZigZag

PostPosted: Fri Mar 20, 2020 5:36 am
by Apprentice
Can you please post your code?
If this is not a problem, can you post your request here?
viewforum.php?f=27

Re: MA ZigZag

PostPosted: Fri Mar 20, 2020 7:24 am
by Gilles
Hi Apprentice,

My code is not finished, so it's under construction. I can't post it right now.

To come back to my question?

I have proposed the realization of a ZigZag indicator whose source is MVA 20 periods. Personally, I get better results with MVA 7 periods.

when I include this indicator in my strategy I get an error message. I wrote this:

MAZZ = core.indicators:create("MA ZigZag", MA.getCandleOutPut(0), Depth, Deviation, Backstep);

How do I write to make it work?
Could you help me?

Thank you in advance for your support.

Re: MA ZigZag

PostPosted: Sat Mar 21, 2020 5:59 am
by Apprentice
MA.getCandleOutPut(0) will nat work.
MA does NOT provide candle output, MA will only provide a single line.
getCandleOutPut(0) will work on source signals that have all close, high, low, open data points.