NilimaCha
(Nilima Chatterjee)
22 July 2024 22:02
1
Hello,
I have just started scripting. I want to write a script to scan stocks intraday in a 5 min timeframe
to return stocks where the Gann Swing has just turned up—bullish —coinciding with a bullish
moving average crossover of 10 and 40 period exponential moving averages.
I want both the signals to occur within 2 bars of each other
I tried
V1 = MA(BARS=10, STYLE=Exponential) ;
V2 = MA(BARS=40, STYLE=Exponential) ;
V3= (V1 CrossesAbove V2):
V4=(GANNSWING(SWINGCOUNT=1,USEINSIDE=FALSE) TURNSUP ) ;
V5= SIGNALAFTER(V4,V3);
V5;
But it doesn’t seem to work very well. Where am I going wrong?
Awaiting your reply,
Regards,
Nilima
DEJHMA8
(Darren Hawkins)
23 July 2024 06:22
2
Try this:
S1=GANNSWING();
V1 = MA(BARS=10, STYLE=Exponential) ;
V2 = MA(BARS=40, STYLE=Exponential) ;
V3=V1 CrossesAbove V2;
V4=S1 TurnsUp;
V5=SIGNALAFTER(V3,V4);
V5
In the example below, V3, V4, and V5 have been plotted separately so you can see the signal only occurs after the moving average crossover:
NilimaCha
(Nilima Chatterjee)
23 July 2024 07:38
3
Thank you-- I will try this script out.
The GannSwing chart referenced in this script-- is it the 3 bar GannSwing?
1)Supposing I want to change the 3 day swing to some other number—how does one do that in the script?
Supposing I wish to add another condition to the scan – that is CCI(20) >35
How do I do that?
DEJHMA8
(Darren Hawkins)
23 July 2024 20:36
4
It’s a 1 bar swing. To change the parameters for any scripting function click on the text to open the properties:
To learn more about scripting see the tutorial courses here: