Doubt in Amibroker Exploration

amitrandive

Well-Known Member
#1
Dear All

I have the following doubt regarding Amibroker exploration/scan.

Where the parameters can be modified from the parameter window, how does the exploration/scan work on the modified parameters?

The Chart changes to reflect the change ,but how do we modify the exploration/scan to reflect what parameters we want?

In such a case does the exploration use the min values defined in the code to give the results.

A sample code indicating this.
Code:
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorGreen ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

MAHighPeriod=Param("MA High Period",5,5,150,1);
MALowPeriod=Param("MA Low Period",20,5,150,1);
Price=Close;
MAHigh=MA(Close,MAHighPeriod); // Replace MA with EMA if you want Exponential MA
MALow=MA(Close,MALowPeriod); // MA with EMA for exponential

Plot(MAHigh,"MA-High", colorRed,styleLine,styleThick);
Plot(MALow,"MA-Low", colorGreen,styleLine,styleThick);

Buy = Cross(Price,MAHigh);
Sell = Cross(MALow,Price);

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,Graph0);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,Graph1);
How can we explore the above code to get Buy/Sell for a crossover of 20/50 MA and another for 50/100,etc
 
#2
You can change parameters from Analysis window . . .

The param window can be opened using the icon that looks like equalizer on music player :)

Another way is to use Optimize instead of Backtest

change this in your code instead of 2 param statements use this

MAHighPeriod=Optimize("MA High Period",20,20,50,30);
MALowPeriod=Optimize("MA Low Period",50,50,100,50);


Happy :)

Edit: Exploration uses default values, but can set the param as mentioned above
 
Last edited:

amitrandive

Well-Known Member
#4
You can change parameters from Analysis window . . .

The param window can be opened using the icon that looks like equalizer on music player :)

Another way is to use Optimize instead of Backtest

change this in your code instead of 2 param statements use this

MAHighPeriod=Optimize("MA High Period",20,20,50,30);
MALowPeriod=Optimize("MA Low Period",50,50,100,50);


Happy :)

Edit: Exploration uses default values, but can set the param as mentioned above
Happy_Singh

Thanks for the reply!!!
:clapping::clapping::clapping:

I was searching for this from a long time,tried and it works.

Thanks again !!!
 

Similar threads