Help! About ParabolicSAR 6 parameters .  [SOLVED]

Questions about MultiCharts and user contributed studies.
xxiao
Posts: 2
Joined: 28 May 2014
Has thanked: 1 time

Help! About ParabolicSAR 6 parameters .

Postby xxiao » 28 May 2014

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.
Attachments
SAR.jpg
(62.19 KiB) Downloaded 819 times

User avatar
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]

Postby JoshM » 29 May 2014

The ParabolicSAR function uses the following inputs:

Code: Select all

inputs:
AfStep( numericsimple ),
AfLimit( numericsimple ),
oParCl( numericref ),
oParOp( numericref ),
oPosition( numericref ),
oTransition( numericref ) ;
The Parabolic SAR indicator only uses three of these (the first three):

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" ) ;
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).

xxiao
Posts: 2
Joined: 28 May 2014
Has thanked: 1 time

Re: Help! About ParabolicSAR 6 parameters .

Postby xxiao » 29 May 2014

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.

User avatar
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 .

Postby JoshM » 30 May 2014

Could you tell me what's the meaning of var4("")? I don't understand this variable.
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. :]

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" ) ;


Return to “MultiCharts”