Simple Coding Help - No Promise.

@JediStar Depending on whether you want the foreground or background color changed:

AddColumn(PercentR(20), "WilliamsR", 1.2, IIf(PercentR(20)<-80,colorRed,IIf(PercentR(20)>-20,colorLime,colorGrey50)));
AddColumn(PercentR(20), "WilliamsR", 1.2, colorDefault, IIf(PercentR(20)<-80,colorRed,IIf(PercentR(20)>-20,colorLime,colorGrey50)));

Thanks a mil bro, much appreciate your time at this part of the night.

Cheers
JS
 
Sir, code posted below (slightly modified). Thanks.
Code:
_SECTION_BEGIN("Engulfing Pattern Identifier");

//////////////////////////////////////////////////////////////////////////

Uptrend = H > Ref(HHV(H,5),-1);
dntrend = L< Ref(LLV(L,5),-1); // Additional line

WhiteBody = C > O;

BlackBody = C < O;

Engulfing = Max(O,C) > Ref(Max(O,C),-1) AND Min(O,C) < Ref(Min(O,C),-1);

BullishEngulfing = Ref(blackbody,-1) AND whitebody AND engulfing AND Ref(dntrend,-1);//Additional line


BearishEngulfing = Ref(whitebody,-1) AND blackbody AND engulfing AND Ref(uptrend,-1);

/////////////////////////////////////////////////////////////////////////////

Plotshapes(BullishEngulfing*shapeuparrow,colorGreen,0,L,-15);
Plotshapes(BearishEngulfing*shapedownarrow,colorred,0,H,-15);


_SECTION_END();
Many Thanks for this AFL, but I think an engulf pattern is when the entire candle [ wicks + body ] engulfs the previous candle [ wicks + body ], what you have written pertains only to body.
 
Many Thanks for this AFL, but I think an engulf pattern is when the entire candle [ wicks + body ] engulfs the previous candle [ wicks + body ], what you have written pertains only to body.
Sir, You can use the following code based on your description of engulfing. Thanks.

Code:
_SECTION_BEGIN("Engulfing Pattern Identifier");

//////////////////////////////////////////////////////////////////////////


WhiteBody = C > O;

BlackBody = C < O;


Engulfing = H>Ref(H,-1) AND L<Ref(L,-1);

BullishEngulfing = Ref(blackbody,-1) AND whitebody AND engulfing;


BearishEngulfing = Ref(whitebody,-1) AND blackbody AND engulfing;

/////////////////////////////////////////////////////////////////////////////

Plotshapes(BullishEngulfing*shapeuparrow,colorGreen,0,L,-15);
Plotshapes(BearishEngulfing*shapedownarrow,colorred,0,H,-15);

_SECTION_END();
 
Sir, You can use the following code based on your description of engulfing. Thanks.

Code:
_SECTION_BEGIN("Engulfing Pattern Identifier");

//////////////////////////////////////////////////////////////////////////


WhiteBody = C > O;

BlackBody = C < O;


Engulfing = H>Ref(H,-1) AND L<Ref(L,-1);

BullishEngulfing = Ref(blackbody,-1) AND whitebody AND engulfing;


BearishEngulfing = Ref(whitebody,-1) AND blackbody AND engulfing;

/////////////////////////////////////////////////////////////////////////////

Plotshapes(BullishEngulfing*shapeuparrow,colorGreen,0,L,-15);
Plotshapes(BearishEngulfing*shapedownarrow,colorred,0,H,-15);

_SECTION_END();


Purrrrfect
 

rmike

Well-Known Member
my requirrment is 50ema only plot in 5 min tf only,not morethan 5min tf or less than 5min tf,so i tweaked >5min<10min (>300<600) but not successs
The params input logic is already provided. You simply have to rearrange inputs to suit your particular requirements!!!

Like so ........
Code:
Plot( EMA( C, 50 ), "EMA50", colorAqua, IIf(Interval() == 5*in1Minute, StyleLine, styleNoDraw));
Read up on the Plot & IIF functions for better understanding of the above
 
sir now its working fine bt it is giving to many signals...i think you should put condition on only near 1 month high and low not crossed high and low..thanks in advance.
@raj_jain1, can you take screen shot of chart created by this afl, put it in "Paint" software and mark where you want the signal to appear (and which ones you don't want them to appear) and post here. Thanks.
 

Similar threads