Dear all,
I want to use parabolicSAR as a exit signal. But I don't know how to set parameters of SAR.
Could you help me ? Many thanks.
Help! About ParabolicSAR 6 parameters . [SOLVED]
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Help! About ParabolicSAR 6 parameters . [SOLVED]
The ParabolicSAR function uses the following inputs:
The Parabolic SAR indicator only uses three of these (the first three):
Looking at these codes, `var0` will be the plotted parabolic SAR line on the chart, and this value is probably what you want to use in your strategy. You now have passed in a value of 0 here, and you probably want to change that with a variable. That way the parabolic SAR value will be stored in that variable, which you then subsequently can use in the strategy.
The first two parameters of the parabolic SAR function (`AfStep` and `AfLimit`) are similar to the indicator settings, so you can just type these over from your plotted indicator to have the strategy perform similar as the indicator on the chart (but do see this wiki page: How to make indicator and signal calculation results the same).
Code: Select all
inputs:
AfStep( numericsimple ),
AfLimit( numericsimple ),
oParCl( numericref ),
oParOp( numericref ),
oPosition( numericref ),
oTransition( numericref ) ;
Code: Select all
inputs: AfStep( 0.02), AfLimit( 0.2 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ), var4( "" ) ;
Value1 = ParabolicSAR( AfStep, AfLimit, var0, var1, var2, var3 ) ;
Plot1( var0, "ParCl" ) ;
The first two parameters of the parabolic SAR function (`AfStep` and `AfLimit`) are similar to the indicator settings, so you can just type these over from your plotted indicator to have the strategy perform similar as the indicator on the chart (but do see this wiki page: How to make indicator and signal calculation results the same).
Re: Help! About ParabolicSAR 6 parameters .
Thank you so much for your explanation.It's very helpful.I will try to use it.
Could you tell me what's the meaning of var4("")? I don't understand this variable.
Could you tell me what's the meaning of var4("")? I don't understand this variable.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Help! About ParabolicSAR 6 parameters .
The `var4` variable seems to be an error in the Parabolic SAR indicator, since it is not referenced in the indicator itself. So you can just ignore that variable. :]Could you tell me what's the meaning of var4("")? I don't understand this variable.
Code: Select all
inputs: AfStep( 0.02), AfLimit( 0.2 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ), var4( "" ) ;
Value1 = ParabolicSAR( AfStep, AfLimit, var0, var1, var2, var3 ) ;
Plot1( var0, "ParCl" ) ;
if var3 = 1 then
Alert( "Bullish reversal" )
else if var3 = -1 then
Alert( "Bearish reversal" ) ;