Yes I got it Cond 3 and cond 6 is for future reference.
Now I made some changes in above mentioned formula. The new afl is as;
_SECTION_BEGIN("MACD Exploration");
r1 = Param( "Fast avg", 66, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Z=Param("zig",1,0,10,0.1);
Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3));
Cond3 = Zig(C,z)>Ref(Zig(C,z),-4);
Buy = Cover = Cond1 AND Cond3;
Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2));
Cond6 = Zig(C,z)<Ref(Zig(C,z),-4);
Sell = Short = Cond4 AND Cond6;
Now the signal is generating on the chart is not future based and the backtesting results not according the chart.
Now how to get accurate results in backtesting ?
Now I made some changes in above mentioned formula. The new afl is as;
_SECTION_BEGIN("MACD Exploration");
r1 = Param( "Fast avg", 66, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Z=Param("zig",1,0,10,0.1);
Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3));
Cond3 = Zig(C,z)>Ref(Zig(C,z),-4);
Buy = Cover = Cond1 AND Cond3;
Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2));
Cond6 = Zig(C,z)<Ref(Zig(C,z),-4);
Sell = Short = Cond4 AND Cond6;
Now the signal is generating on the chart is not future based and the backtesting results not according the chart.
Now how to get accurate results in backtesting ?
Zig function itself looks into future
Go to Analysis > Code check and Profile , you will get the answer ..