Simple Coding Help - No Promise.

dell

Well-Known Member
senior's ,if we want to apply a stoploss of 15 points from buy price /short price , than how to do that ?

buy=ema(c,5) > ema(c,20);
short=ema(c,5)<ema(c,20);
sell =ema(c,5)<ema(c,20);
cover=ema(c,5) > ema(c,20);
how to write cover and sell condition in this ?
we need 15 point sl , so either original sl or 15 point sl , whichever trigger earlier ,will be our sl .
 
I have 6 setups in place, 3 buys and 3 sells and have written a separate column for each of them, so every time I run a scan there are 6 columns displayed in scanner with setups name. and buy or sell displayed below it

I wish to bring it down to only one column, where setup name's are displayed into it.

If any one knows how to do it, please guide me.
 

ethan hunt

Well-Known Member
Detecting DT DB within a range of 0.5% of previous days / bars High Low:

Not working, kindly help...

AFL:

doubletop = ((High*0.995) < (Ref( High , -1 )) < (High*1.005)) OR (High == Ref( High , -1 ));

doublebottom = ((Low*0.995) < (Ref( Low , -1 )) < (Low*1.005)) OR (Low == Ref( Low , -1 ));

Buy = doubletop;

Sell = doublebottom;

Filter=Sell OR Buy ;

{
AddColumn( IIf( doubletop , 88, 01), "DT", formatChar );
AddColumn( IIf( doublebottom , 88, 01), "DB", formatChar );
AddColumn(High, "High", 6.2, colorDefault, colorDefault, 120);
AddColumn(Low, "Low", 6.2, colorDefault, colorDefault, 120);
AddColumn(Volume, "Volume", 6.2, colorDefault, colorDefault, 120);
}
 
senior's ,if we want to apply a stoploss of 15 points from buy price /short price , than how to do that ?

buy=ema(c,5) > ema(c,20);
short=ema(c,5)<ema(c,20);
sell =ema(c,5)<ema(c,20);
cover=ema(c,5) > ema(c,20);

how to write cover and sell condition in this ?
we need 15 point sl , so either original sl or 15 point sl , whichever trigger earlier ,will be our sl .
Something similar must be already there on the thread but anyway . . .

Code:
B = Cross(EMA(C,5), EMA(C,20));
S = Cross(EMA(C,20),EMA(C,5) );
B = ExRem(B,S); 	
S = ExRem(S,B);
U = Flip(B,S);
D = Flip(S,B);
BS= U AND L < ValueWhen(B)-15;
SS= D AND H > ValueWhen(S)+15;
Buy   = B;			
Sell  = S OR BS;
Short = S;
Cover = B OR SS;

Buy=ExRem(Buy,Sell); 	
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
using the above template, others can modify it for their requirement.


Happy :)
 

cellclinic

Well-Known Member
Happy jee ... code is giving error on line Shown in red .

Something similar must be already there on the thread but anyway . . .

Code:
B = Cross(EMA(C,5), EMA(C,20));
S = Cross(EMA(C,20),EMA(C,5) );
B = ExRem(B,S); 	
S = ExRem(S,B);
U = Flip(B,S);
D = Flip(S,B);
[COLOR="Red"]BS= U AND L < ValueWhen(B)-15;
SS= D AND H > ValueWhen(S)+15;[/COLOR]
Buy   = B;			
Sell  = S OR BS;
Short = S;
Cover = B OR SS;

Buy=ExRem(Buy,Sell); 	
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
using the above template, others can modify it for their requirement.


Happy :)
 

Similar threads