Simple Coding Help - No Promise.

Sir... I am trying to design this system based on Russ Horn's Secret Method....

I have used 4 afls for the requested strategy sir... can we combine them to make it one sir??

I have attached the a screenshot which shows the system designed... and also the AFLs used in it...
 
Sir... I have used 4 AFLs to design this system... Can they be combined and made as one AFL???

This system is Russ Horn's Secret Method which is been designed for MT4...

Sir... If I had OBV, Stoch and CCI Indicators... What are the parameters to be used???

I have put the AFLs used and the information about the system in the link below...

www(dot)mediafire(dot)com/download/in7bsha195qkepg/Strategy+Req(dot)rar

Please help me to get this system in Amibroker with required AFLs so it gives BUY/SELL signals when conditions are met and also would like to get a scan/exploration afl so it scans the stocks for the conditions mentioned......
 
Last edited:

pratapvb

Well-Known Member
Most of the system will fail in range bound market, I was testing TSI on Gold when it was range bound yesterday

Please see below chart


upload a picture


TSI support was broken in range bound market and Gold gave nice fall and again in range bound market Gold broke resis and gave good rally.


Similar to example chart


how to capture screen

Below code is used to plot recent support and resistance on price chart

Code:
_SECTION_BEGIN("supp");
("Price");
RSIperiod = 15; // Param("RSI p",3,14,30,1);
Percent = 5; // Param("ZIG %",8,9,15,1);
EMAperiod = 5; //Param("EMA p",4,5,10,1);
HHVperiod = 8; //Param("HHV p",3,5,10,1);
NumLine = 2; //Param("Num Lines",3,1,20,1);

Base = DEMA(RSI(RSIperiod),EMAperiod);

GraphXSpace=0.5;


for( i = 1; i <= numline; i++ )
{
ResBase = LastValue(Peak(Base,Percent,i));
SupBase = LastValue(Trough(Base,Percent,i));
Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "", colorRed, styleLine);
Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "", colorGreen, styleLine);
}

_SECTION_END();
can it it modified and used on TSI ? or any other code to plot support and resi on TSI indicator itself
Could you please share coding for this ?
http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:true_strength_index

Code:
// TSI indicator
usetf = ParamToggle("Use TF", "No|Yes", 0) ;
tf = Param("TF", 6, 1, 10000) ;

p1 = 25 ;
p2 = 13 ;
sigp = 3 ;
showsig = ParamToggle("Show Signal", "No|Yes", 1) ;
Onsignal = ParamToggle("Rib on", "Slope|Signal", 1) ;

expandmode = expandFirst ;

tfs = tf * in1Minute;

if (usetf)
	TimeFrameSet(tfs) ;

pc = C - Ref(C, -1) ;
pc1 = EMA(pc, p1) ;
pc2 = EMA(pc1, p2) ;

apc = abs(C - Ref(C, -1)) ;
apc1 = EMA(apc, p1) ;
apc2 = EMA(apc1, p2) ;

tsie = tsi = 100 * (pc2 / apc2) ;
sige = sig = EMA(tsi, sigp) ;

Clrlong = colorBlue ;
Clrlongpb = colorLightBlue ;
Clrshort = colorRed ;
Clrshortpb = colorRose ;

Clrrib = H-H ;

if (Onsignal)
	Clrrib = IIf(tsi > 0, IIf(tsi >= sig, Clrlong, Clrlongpb),
						IIf(tsi <= sig, Clrshort, Clrshortpb)) ;
else
	Clrrib = IIf(tsi > 0, IIf(tsi > Ref(tsi, -1), Clrlong, Clrlongpb),
						IIf(tsi < Ref(tsi, -1), Clrshort, Clrshortpb)) ;

Clrribe = Clrrib ;

if (usetf)
{
	tsie = TimeFrameExpand(tsi, tfs, expandmode) ;
	sige = TimeFrameExpand(sig, tfs, expandmode) ;
	Clrribe = TimeFrameExpand(Clrrib, tfs, expandmode) ;


	TimeFrameRestore() ;
}

Plot(tsie, "TSI", colorBlue) ;
if (showsig)
	Plot(sige, "Signal", colorRed) ;

showrib = True ;
ribht = 3 ;

if (showrib)
	Plot(ribht, "", Clrribe, styleArea|styleOwnScale|styleNoLabel, 0, 100) ;
 
Sir... I am trying to design this system based on Russ Horn's Secret Method....

I have used 4 afls for the requested strategy sir... can we combine them to make it one sir??

I have attached the a screenshot which shows the system designed... and also the AFLs used in it...
Where is the screen shot attached?
 

hmp

Well-Known Member
Hi
Following is the afl for intraday 30 min.orb system.Now can someone add scanning with buy/sell arrow to it? Other condition is there should be ema 5 should cross from below or above to ema 20 for buy & sell.

// Open Range Breakout AFL
// Abnash Singh 31/10/2011
// [email protected]
// This is a simple AFL which will be developed further based on user input.
// SL and re-entry signals will be added.
// Switching from candle to bar chart will be added
// Profit levels will be added
// Current ORB level time is set as 9.45 a.m. which can be easily changed
SetBarsRequired(1000,0);
ORBtype=ParamList("ORB Single or Two levels?","Single|Two");
Style=ParamList("Plot Bars or Candle","Bars|Candle");
BarColor = IIf(Close > Open, colorGreen, colorRed);
SetBarFillColor(BarColor);
if(style=="Bars")Cstyle=styleBar;
else Cstyle=styleCandle;
Plot(C,"Close",colorWhite,Cstyle);
timesetting=094500;
tn=TimeNum();
Datey=DateNum();
fastprice=lev=0;
avp=(O+C)/2;
r2=s2=ar1=ar2=ar3=bs1=bs2=bs3=0;
fastbuy=fastsell=0;
gapzz=10;
Lastsig=Buycond=Shortcond=dayopen=dayclose=dayhigh=daylow=0;
for (i=2;i<BarCount;i++)
{

//PlotText(WriteVal(1,1.0),i,H+15,colorWhite);

//day high low logic
if (Datey!=Datey[i-1])
{
Dayopen=O;
Dayclose=C;
Buycond=Shortcond=lastsig=0;
ar1=ar2=ar3=bs1=bs2=bs3=0;
fastprice=lev=0;
}
if (Datey==Datey[i-1])
{
Dayopen=Dayopen[i-1];
Dayclose=Dayclose[i-1];
Dayhigh=Dayhigh[i-1];
Daylow=Daylow[i-1];
}
if (H>Dayhigh)Dayhigh=H;
if (Daylow==0)Daylow=L;
if (L<Daylow)Daylow=L;
// day high low logic end
//PlotText(WriteVal(i,1.0),i,H+10,colorWhite);

if (tn<timesetting )
{
//PlotText(WriteVal(1,1.0),i,H+10,colorWhite);

r2=Dayhigh;
s2=Daylow;
if (ORbtype=="Single")fastprice=r2=s2=(Dayhigh+Daylow)/2;
}
else
{
//PlotText(WriteVal(1,1.0),i,H+10,colorWhite);

r2=r2[i-1];
s2=s2[i-1];
}
Lev=0;
if (ORbtype=="Single")
{
fastprice=r2;
if (avp>r2)Lev=1;
if (avp<s2)Lev=8;

}
else
{
if (avp>r2){fastprice=r2;Lev=1;}
if (avp<s2){fastprice=s2;Lev=8;}
if (avp<r2 AND avp>s2 AND avp>(r2+s2)/2){fastprice=r2;}
if (avp<r2 AND avp>s2 AND avp<(r2+s2)/2){fastprice=s2;}
}

if (Lev==1)
{
ar1=avp-r2;ar2=avp[i-1]-r2;ar3=avp[i-2]-r2;
//passthrough
if (avp>r2 AND avp[i-1]<r2)Buycond=1;
//kiss and go above
if (ar2<gapzz AND ar1>ar2 AND ar3>ar2) Buycond=1;
}
if (Lev==8)
{
bs1=s2-avp;bs2=s2-avp[i-1];bs3=s2-avp[i-2];
//pass through
if (avp[i-1]>s2 AND avp<s2)Shortcond=1;
//kiss and go
if (bs2<gapzz AND bs1>bs2 AND bs3>bs2) Shortcond=1;
}
if (Lev==1 AND Buycond==1 AND Lastsig!=1)
{
fastbuy=1;
Lastsig=1;
Buycond=shortcond=0;
}
if (Lev==8 AND Shortcond==1 AND Lastsig!=-1)
{
fastsell=1;
Lastsig=-1;
Buycond=shortcond=0;
}
}
shape = fastBuy * shapeUpArrow + fastSell * shapeDownArrow;
PlotShapes( shape, IIf( fastBuy, colorLime, colorRed ), 0, IIf( fastBuy, Low, High));
if (ORbtype=="Single")
{
Plot(r2,"R2",colorYellow,styleLine|styleDashed|styleNoTitle);
}
else
{
Plot(r2,"R2",colorYellow,styleLine|styleDashed|styleNoTitle);
Plot(s2,"S2",colorRed,styleLine|styleDashed|styleNoTitle);
}

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

Thanks & regards
 

sr114

Well-Known Member
Sir... I have used 4 AFLs to design this system... Can they be combined and made as one AFL???

This system is Russ Horn's Secret Method which is been designed for MT4...

Sir... If I had OBV, Stoch and CCI Indicators... What are the parameters to be used???

I have put the AFLs used and the information about the system in the link below...

www(dot)mediafire(dot)com/download/in7bsha195qkepg/Strategy+Req(dot)rar

Please help me to get this system in Amibroker with required AFLs so it gives BUY/SELL signals when conditions are met and also would like to get a scan/exploration afl so it scans the stocks for the conditions mentioned......
for plotting , at least 2 panes are required



but in the main afl u cud put the exploration code

rgds
 
Hi Sir.. Needed an exploration afl for following conditions sir... Unable to know how to do it sir....

1. A bullish Heiken Ashi candle (white) crosses above the 14 SMA.
2. The OsMA crosses above its Zero level.
3. The Momentum indicator crosses above the 100 level.
4. The RSI crosses above the 50 level.
5. As soon as all conditions mentioned above are met, we wait for the current candle to
close then display BUY

A bearish Heiken Ashi candle (red) crosses below the 14 SMA.
2. The OsMA moves below the Zero level.
3. The Momentum indicator crosses below the 100 level.
4. The RSI crosses under the 50 level.
5. As soon as all conditions mentioned above are met, wait for the current candle to
close and then display SHORT
Momentum Indicator is simply difference of two close prices. It cannot be above 100 for most of the forex currencies, most of the time. Therefore the MT4 formula does not use default Momentum Indicator formula. It had to be amended for forex and you now need to carry forward that amendment.

The appropriate formula from momentum in this case should be translated into Amibroker either as

Code:
momentum = HaClose * 100 / Ref(HaClose, -Param("Period", 10, 1, 100 ) );
OR (if you want to be very accurate)

Code:
momentum = Close * 100 / Ref(Close, -Param("Period", 10, 1, 100 ) );
 
Momentum Indicator is simply difference of two close prices. It cannot be above 100 for most of the forex currencies, most of the time. Therefore the MT4 formula does not use default Momentum Indicator formula. It had to be amended for forex and you now need to carry forward that amendment.

The appropriate formula from momentum in this case should be translated into Amibroker either as

Code:
momentum = HaClose * 100 / Ref(HaClose, -Param("Period", 10, 1, 100 ) );
OR (if you want to be very accurate)

Code:
momentum = Close * 100 / Ref(Close, -Param("Period", 10, 1, 100 ) );

Thank U sir... Will add once @sr114 sir shares the code...

Can we add other indicators to improvise or make the system better sir???

Please suggest sir....
 

Similar threads