Hi,
I am very new to amibroker and coding.
With the help of the Bandy book "Quantitative Trading Systems"
I wrote a simple formula to filter out trades. The formula works
but I do not understand a part of the code. If possible I would
like a simple "For Dummies" explanation.
The filter checks the S&P to ensure the close is above 10 month Moving average.
Here's the code -
SetForeign("^GSPC");
TimeFrameSet( inMonthly );
Foreignma = MA(Close, 10);
Permit = C > Foreignma ;
PermitSwitch = 1;
Permit = IIf(PermitSwitch == 1, Permit , 0);
What I need further explanation on is this section -
PermitSwitch = 1;
Permit = IIf(PermitSwitch == 1, Permit , 0);
I do understand the IIf function but I don't understand
the " PermitSwitch " portion. Could someone explain what
this part of code is doing?
Thanks in advance for your help.
- Abbie