Simple Coding Help - No Promise.

need to take help of seniors, not able to write code for above high of signal candle
Nehal Sir indeed sounds nice :lol: :clap:

BTW, where is Happy Sir nowadays?
 
Dear All AFL Seneors,

I require Exploration(Scanner) for the following conditions.
for Buy Condition.
1. Candel crossed and closed above cross of EMA 5 above EMA 20 and EMA 20 above EMA 30.

2. Candel Crossed ATR 10 Factor 4.

3. RSI 14 is above 50

4. ADX 14 above 30

Reverse for Sale Condition.

I need only scanner for stock fulfilling this conditions.

Thanks and regards.

Maruti Mane
Dear Maruti

Code:
e5 = EMA(C, 5);
e20 = EMA(C, 20);
e30 = EMA(C, 30);
a4  = ATR(10); // Factor 4 cannot be used directly. you need to be more specific
rsi14 = RSI(14);
adx14 = ADX(14);

Buy = Cross(e5, e20) AND (e20 > e30) AND  (C > a4) AND (rsi14 > 50) AND (adx14 > 30);
Short = Cross(e30, e20) AND (e20 > e5) AND (a4 > C) AND (rsi14 < 50) AND (adx14 < 30);
Filter = Buy OR Short;
This AFL does what you've stated except ATR factor 4 which cannot be directly included.

Also, it is practically very very rare for e5 to cross e20 at the same time as e20 is crossing e30. it is not impossible but it is rare, therefore I am using only one cross where you meant two.

Surprisingly enough, your remaining conditions are also mutually exclusive of each other and scanner brings out nothing. So comment out one by one and
see if you get somewhere.

Sell and Cover logic is not provided
 

toughard

Well-Known Member
need to take help of seniors, not able to write code for above high of signal candle
sir thanks for your time and selfless support.

Can any seniors can help in this regard?

toughard
 

toughard

Well-Known Member
Sir is it possible to arrive at the closing value of the signal (signal candle)?
 
sir thanks for your time and selfless support.

Can any seniors can help in this regard?

toughard
toughard

Go back to page 66-68 and someone named Abhijeet had asked which was replied by me. It was presented few times on very early pages 10-15 as well but it was in a slightly different style.
 

Nehal_s143

Well-Known Member
I think mastermind007 sir is talking about this

ema200 = EMA(Close, 200);
hhv6 = HHV(High, 6);
llv6 = LLV(Low, 6);

XBuy = Ref(Close, -5) < Ref(ema200, -5) AND
Ref(Close, -4) > Ref(ema200, -4) AND
Ref(Close, -3) > Ref(ema200, -3) AND
Ref(Close, -2) > Ref(ema200, -2) AND
Ref(Close, -1) > Ref(ema200, -1) AND
Close > ema200;

XSell = Ref(Close, -5) > Ref(ema200, -5) AND
Ref(Close, -4) < Ref(ema200, -4) AND
Ref(Close, -3) < Ref(ema200, -3) AND
Ref(Close, -2) < Ref(ema200, -2) AND
Ref(Close, -1) < Ref(ema200, -1) AND
Close < ema200;

BuyStop = ValueWhen(XBuy, hhv6);
Buy = Close > BuyStop;
SellStop = ValueWhen(XSell, llv6);
Sell = Close < SellStop;
 

toughard

Well-Known Member
toughard

Go back to page 66-68 and someone named Abhijeet had asked which was replied by me. It was presented few times on very early pages 10-15 as well but it was in a slightly different style.

Mastermind sir,
I did my hard work and tried many things but its far above my level of little knowledge,
Can any one who is expert in this regard show some way?

thanks

toughard
 
I think mastermind007 sir is talking about this

ema200 = EMA(Close, 200);
hhv6 = HHV(High, 6);
llv6 = LLV(Low, 6);

XBuy = Ref(Close, -5) < Ref(ema200, -5) AND
Ref(Close, -4) > Ref(ema200, -4) AND
Ref(Close, -3) > Ref(ema200, -3) AND
Ref(Close, -2) > Ref(ema200, -2) AND
Ref(Close, -1) > Ref(ema200, -1) AND
Close > ema200;

XSell = Ref(Close, -5) > Ref(ema200, -5) AND
Ref(Close, -4) < Ref(ema200, -4) AND
Ref(Close, -3) < Ref(ema200, -3) AND
Ref(Close, -2) < Ref(ema200, -2) AND
Ref(Close, -1) < Ref(ema200, -1) AND
Close < ema200;

BuyStop = ValueWhen(XBuy, hhv6);
Buy = Close > BuyStop;
SellStop = ValueWhen(XSell, llv6);
Sell = Close < SellStop;
Nehal

Good job!

Yes, That is what I was talking about.


P.S. I did receive the files that you've sent me but at the moment I am too busy to take a proper look at it.
 
I think mastermind007 sir is talking about this

XBuy = Ref(Close, -5) < Ref(ema200, -5) AND
Ref(Close, -4) > Ref(ema200, -4) AND
Ref(Close, -3) > Ref(ema200, -3) AND
Ref(Close, -2) > Ref(ema200, -2) AND
Ref(Close, -1) > Ref(ema200, -1) AND
Close > ema200;

XSell = Ref(Close, -5) > Ref(ema200, -5) AND
Ref(Close, -4) < Ref(ema200, -4) AND
Ref(Close, -3) < Ref(ema200, -3) AND
Ref(Close, -2) < Ref(ema200, -2) AND
Ref(Close, -1) < Ref(ema200, -1) AND
Close < ema200;

That amateurish code by Minimind again. Yeah, learn how to do amateurish codes.

Pros do it like this
XBuy = Ref(Close, -5) < Ref(ema200, -5) AND Sum ( C > ema200, 5 ) == 5;
XSell = Ref(Close, -5) > Ref(ema200, -5) AND Sum ( C < ema200, 5 ) == 5;

Amateurs like Minime would use thousands of Refs and would sit hours in front of their PC just to achieve that.
"How many Refs do I have to add yet? Phew, still 990? Noooooooooo.............!!!!!!!!!!!!!!!! Please fire me the Minime! 989, 988, 987, ... , 985. I'm waiting, please. I can't take it anymore. I'm crying rivers. 984, 983, ... Phew still at 982. Please help me. I'm dying"
:D

Talking about amateurs... Where is my lovely copy&paste thug ford7k ?
 
That amateurish code by Minimind again. Yeah, learn how to do amateurish codes.
...
This thread is for those newbies who are learning AFL and writing professional code to show off that you are better than them is most pathetic.... its beyond pathetic

Tere mein agar dum hai to yeh code ko samaza ki dikha.

Code:
char*_ = "'""/*";
#include <stdio.h>
#define m 21
#define o(l, k) for(l=0; l<k; l++)
#define n(k) o(T, k)


              int E,L,O,R,G[42][m],h[2][42][m],g[3][8],c
              [42][42][2],f[42]; char d[42]; void v( int
              b,int a,int j){ printf("\33[%d;%df\33[4%d"
              "m  ",a,b,j); } void u(){ int T,e; n(42)o(
              e,m)if(h[0][T][e]-h[1][T][e]){ v(e+4+e,T+2
              ,h[0][T][e]+1?h[0][T][e]:0); h[1][T][e]=h[
              0][T][e]; } fflush(stdout); } void q(int l
                            ,int k,int p){
                            int T,e,a; L=0
                            ; O=1; while(O
                            ){ n(4&&L){ e=
                            k+c[l] [T][0];
                            h[0][L-1+c[l][
                            T][1]][p?20-e:
e]=-1; } n(4){                                          e=k+c[l][T][0]; a=L+c[l][T][
1]+1; if(a==42                                          || h[0][a][p?20-e:e]+1){ O=0
; } } n(4){ e=                                          k+c[l][T][0]; h[0][L + c[l][
T][1]][p?20-e:                                          e]=g[1][f[p?19+l:l]]; } L++;
u(); } n(42) {                                          o(e,m)if(h[0][T][e]<0)break;
o(a, m&&e==m){                                          for(L=T; L; L--) { h[0][L][a
]=h[0][L-1] [a                                          ]; } h[0][0][a]=-1; } } u();
}int main(){ int T,e,t,r,i,s              ,D,V,K; printf("\33[2J\33[?25l"); n(8)g[i=
1][T]=7-T; R--; n(42) o(e,m)              G[T][e]--; while(fgets(d,42,stdin)) { r=++
R; n(17){ e=d[T]-48; d[T]=0;              if ((e&7)==e) { g[0][e] ++; G[R][T+2]=e; }
} } n(8)if(g[0][7-T]){ t=g[i              ][O]; g[i][O++]=g[i][T]; g[i][T]=t; } n(8)
g[2][g[i][T]]=T; n(R+i)o(e,m              )if(G[T][e]+i) G[T][e]=g[2][G[T][e]]; n(19
)o(t,2){ f[T+t+T]=(T["+%#,4"              "5>GP9$5-,#C?NX"]-35)>>t*3&7; o(e,4){ c[T]
[e][t]=("5'<$=$8)Ih$=h9i8'9"              "t=)83)l4(99(g9>##>4(" [T+t+T]-35)>>e*2&3;
} } n(15) { s=T>9?m:(T&3)-3?15:36;o(e,s)o(t,2)c[T+19][e][t]="6*6,8*6.608.6264826668\
865::(+;0(6+6-6/8,61638065678469.;88))()3(6,8*6.608.6264826668865:+;4)-*6-6/616365,\
-6715690.5;,89,81+,(023096/:40(8-7751)2)65;695(855(+*8)+;4**+4(((6.608.626482666886\
5:+;4+4)0(8)6/61638065678469.;88)-4,4*8+4(((60(/6264826668865:+;4-616365676993-9:54\
+-14).;./347.+18*):1;-*0-975/)936.+:4*,80987(887(0(*)4.*""/4,4*8+4(((6264826668865:\
+;4/4-4+8-4)0(8)6365678469.;88)1/(6*6,6.60626466686:8)8-8*818.8582/9863(+;/""*6,6.6\
0626466686:4(8)8-8*818.8582/9863(+;/,6.60626466686:8-818.8582/9864*4+4(0())+;/.6062\
6466686:8/8380/7844,4-4*4+4(0())69+;/0626466686:818582/9864.4/4,4-4*4+4(0())+;" [e+E
+e+t]-40; E+=s+s; } n(45){ if(T>i) { v(2,T,7); v(46,T,7); } v(2+T,44,7); } T=0; o(e,
42)o(t,m)h[T][e][t]--; while(R+i) { s = D=0; if (r-R) { n(19) if (G[R+i][T]+i) V=T/2
; else if(G[R][T]+i) s++; if(s) { if(V>4){ V=9-V; D++; } V+=29; n(20) q(c[V][T][0],c
[V][T][i],D); } } n(19) if((L=G[R][T])+i) { O=T-L; e=O>9; t=e?18-O :O; o(K,((t&3)-3?
16:37)){ if(K){ L=c[t+19][K-i][0]; O=c[t+19][K-i][i] ; } q(L,O,K && e); } } if(s) q(
c[V][20][0], c[V][20][i], D); R--; } printf("\33[47;1f\33[?25h\33[40m"); return 0; }
 

Similar threads