Simple Coding Help - No Promise.

arora

Please re-get the code in my earlier post
http://www.traderji.com/amibroker/90119-simple-coding-help-no-promise-279.html#post1049804

There are two more lines in which you need to replace Avg with High. I had missed them earlier.

Those two lines are not very important since they refer to very first zig (beginning of chart) and error will not even be evident in majority of the scrips.

Only those that have listed in Dec 2014 may plot incorrectly without this additional correction.
 

Nehal_s143

Well-Known Member
Will you pl. provide me a link where i can find full tTTB afl?The afl provided by you is of KRA & that does not have this explore feature.
Thanks & regards.
T3B Afl with explore, Downloaded from wisestock.com

Code:
// MIRIP YG MAHAL (T3B) BY TIMUR LANGIT

pStyle = ParamList("Price Style", "Candle|Solid Candle|Bar|Line|Heikin-Ashi",2);
cBull = ParamColor("Price Bull", colorBlue);
CBear = ParamColor("Price Bear", colorRed);
cLine = ParamColor("Price Line", colorWhite);
ThisStyle = styleCandle;
ThisTitle = "";

_O=O; _C=C; _H=H; _L=L;

ThisColor = IIf( _C>_O, cBull, IIf(_C<_O, CBear, CLine));


switch (pStyle )
{

  case "Solid Candle":   
        SetBarFillColor( ThisColor ); 
        break;


  case "Bar": 
       ThisStyle = styleBar;
       break;

  case "Line": 
      ThisStyle = styleLine;
      ThisColor = cLine;
       break;


  case "Heikin-Ashi": 
       _C = (O+H+L+C)/4; 
          _O = AMA( Ref( _C, -1 ), 0.5 ); 
       _H = Max( H, Max( _C, _O ) ); 
       _L = Min( L, Min( _C, _O ) ); 

       ThisColor = IIf(_C >= _O,CBull, CBear);
       SetBarFillColor( ThisColor );
 
       ThisColor = IIf(_C >= _O,cLine, cLine);
          ThisTitle = "Heikin-Ashi";
       break;

  default:   
        SetBarFillColor( ThisColor ); 
        ThisColor = cLine;

       break;

}

   PlotOHLC( _O, _H, _L, _C, ThisTitle, ThisColor, ThisStyle); 
   GraphXSpace = 8;

_SECTION_END();  


 

_SECTION_BEGIN("Fractal");

UpFractal= ValueWhen(( High>= Ref(High,-1) AND
High>= Ref(High, 1) AND
High>= Ref(High, 2) AND
High>= Ref(High,3 ) AND
High> Low),H);

 

DownFractal= ValueWhen(((
Low<=Ref(Low, 1) AND
Low<=Ref(Low, 2) AND
Low<=Ref(Low, 3) AND
Low<=Ref(Low,-1))),L);

Buy = (Ref(C,-1)<=UpFractal) AND C>UpFractal AND V >= MA(V,20);

Sell = (Ref(C,-1)>=DownFractal) AND C<DownFractal;

 

//Buy=ExRem(Buy,Sell);

Sell=ExRem(Sell,Buy);

 
dec = (Param("Decimals",2,0,7,1)/10)+1;
bi = BarIndex();
Lbi = LastValue(BarIndex());
sbi = SelectedValue(bi);
x1= BarCount-1;
Title = EncodeColor(55)+ Title = Name() + " " + EncodeColor(32) + Date() +
" " + EncodeColor(5) + "{{INTERVAL}} " +
EncodeColor(55)+ " Open = "+ EncodeColor(52)+ WriteVal(O,dec) + 
EncodeColor(55)+ " High = "+ EncodeColor(5) + WriteVal(H,dec) +
EncodeColor(55)+ " Low = "+ EncodeColor(32)+ WriteVal(L,dec) + 
EncodeColor(55)+ " Close = "+ EncodeColor(52)+ WriteVal(C,dec)+
EncodeColor(55)+ " Volume = "+ EncodeColor(52)+ WriteVal(V,1)+
EncodeColor(colorBlue)+ " Peak = "+ EncodeColor(52)+ WriteVal(UpFractal,1.2)+
EncodeColor(colorRed)+ " Trough = "+ EncodeColor(52)+ WriteVal(DownFractal,1.2);

 Plot(Ref(UpFractal,2), "T3B Peak",

ParamColor("resistance",colorBlue), ParamStyle("Up Fractal Style", styleLine));

Plot(Ref(DownFractal,3), "T3B Trough",ParamColor("Support",colorRed),

ParamStyle("Down Fractal Style", styleLine));

 

_SECTION_END();

_SECTION_BEGIN("Exploration");

Filter= V>0 AND C;

HI = IIf(H>HHV(Ref(H,-1),60),1,0);
LO = IIf(L<LLV(Ref(L,-1),60),1,0);
Peak1 = (Ref(H,-1)<=UpFractal)AND H>=UpFractal ;
Trough1 = Ref(L,-1)>=DownFractal AND L < DownFractal;
AccVolx1 = IIf(V>=1*MA(V, 125),1,0);
 
AddColumn(O,"Open"); 
AddColumn(H,"High"); 
AddColumn(L,"Low"); 
AddColumn(C, "Close");
AddColumn(V, "Volome");
AddColumn(HI, "New High");
AddColumn(LO, "New Low");
AddColumn(Peak1, "Peak");
AddColumn(Trough1, "Trough");
AddColumn(AccVolx1, "Acc Vol ");

_SECTION_END();
 
Hi,
i am looking out for the coding where the calculation starts from the time we have specified.
for instance:
we have a buy setup crossover of EMA (c,10) , ema(c,20)
if we want that ema should start calculating from 5 p.m onwards than how the coding to be made?
Mehtaka bro,
Thanks for the Idea.
Iam sure u hv alrdy figured it out.
The Chart looks Weird , but the backTesting (1 month) and PaperTrading (3days) Results r gud.

Thank u
shiraj
 
Does anyone have the afl for Rahul Mohinder ATM ZoneDetect ZD and ATM zone Fill and any feedback as to how it works ?

Regards
I have RMO afl which does have buy/sell embedded into it.

SwingTrd1 = 100 * (Close - ((MA(C,2)+
MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) +
MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2), 2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2), 2),2),2),2)) /10))/(HHV(C,10)-LLV(C,10));
SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);
RMO= EMA(SwingTrd1,81);

Buy=Cross(SwingTrd2,SwingTrd3);
Sell=Cross(SwingTrd3,SwingTrd2);

Bull_Trend=EMA(SwingTrd1,81)>0;
Bear_Trend=EMA(SwingTrd1,81)<0;
Ribbon_kol=IIf(Bull_Trend,colorGreen, IIf(Bear_Trend,colorRed, colorBlack));
Plot(4, "ribbon", Ribbon_kol, styleOwnScale|styleArea|styleNoLabel, -0.5,100);

I have no idea about zonedetect thing you've mentioned
 
I have RMO afl which does have buy/sell embedded into it.

SwingTrd1 = 100 * (Close - ((MA(C,2)+
MA(MA(C,2),2)+
MA(MA(MA(C,2),2),2) +
MA(MA(MA(MA(C,2),2),2),2) +
MA(MA(MA(MA(MA(C,2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2) +
MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2),2), 2),2)+
MA(MA(MA(MA(MA(MA(MA(MA(MA(MA(C,2),2),2),2),2),2), 2),2),2),2)) /10))/(HHV(C,10)-LLV(C,10));
SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);
RMO= EMA(SwingTrd1,81);

Buy=Cross(SwingTrd2,SwingTrd3);
Sell=Cross(SwingTrd3,SwingTrd2);

Bull_Trend=EMA(SwingTrd1,81)>0;
Bear_Trend=EMA(SwingTrd1,81)<0;
Ribbon_kol=IIf(Bull_Trend,colorGreen, IIf(Bear_Trend,colorRed, colorBlack));
Plot(4, "ribbon", Ribbon_kol, styleOwnScale|styleArea|styleNoLabel, -0.5,100);

I have no idea about zonedetect thing you've mentioned
Why making it so complicated if the earth was made with ease and for ease of use?

Code:
x = MA( C, 2 );
y = x;
for ( i = 1; i < 10; i++ )
{
    y = MA( y, 2 );
    y += x;
}

SwingTrd1 = 100 * (Close - (y / 10)) / (HHV(C, 10) - LLV(C, 10));
SwingTrd2=EMA(SwingTrd1,30);
SwingTrd3=EMA(SwingTrd2,30);
RMO= EMA(SwingTrd1,81);

Buy=Cross(SwingTrd2,SwingTrd3);
Sell=Cross(SwingTrd3,SwingTrd2);

Bull_Trend=EMA(SwingTrd1,81)>0;
Bear_Trend=EMA(SwingTrd1,81)<0;
Ribbon_kol=IIf(Bull_Trend,colorGreen, IIf(Bear_Trend,colorRed, colorBlack));
Plot(4, "ribbon", Ribbon_kol, styleOwnScale|styleArea|styleNoLabel, -0.5,100);
 

Similar threads