Bitvested / ta.py

Financial Technical Analysis in Python
MIT License
69 stars 27 forks source link

Williams Alligator not matching the one in trading view. Is it production ready? #10

Open dsp1589 opened 1 month ago

dsp1589 commented 1 month ago

I pulled out some day level data and run the Williams alligator and the result does not match the TradingView. I tried both hl2 and close values as input and both did not yield the correct results.

Pine script used by TradingView.

//@version=5 indicator(title="Williams Alligator", shorttitle="Alligator", overlay=true, timeframe="", timeframe_gaps=true) smma(src, length) => smma = 0.0 smma := na(smma[1]) ? ta.sma(src, length) : (smma[1] * (length - 1) + src) / length smma jawLength = input.int(13, minval=1, title="Jaw Length") teethLength = input.int(8, minval=1, title="Teeth Length") lipsLength = input.int(5, minval=1, title="Lips Length") jawOffset = input(8, title="Jaw Offset") teethOffset = input(5, title="Teeth Offset") lipsOffset = input(3, title="Lips Offset") jaw = smma(hl2, jawLength) teeth = smma(hl2, teethLength) lips = smma(hl2, lipsLength) plot(jaw, "Jaw", offset = jawOffset, color=#2962FF) plot(teeth, "Teeth", offset = teethOffset, color=#E91E63) plot(lips, "Lips", offset = lipsOffset, color=#66BB6A)

dsp1589 commented 1 month ago

I tried both 13,8,5(8,5,3) and 21,13,8(13,8,5) as inputs

Vultwo commented 1 month ago

Hi, could you provide some raw input and output data?