AFL required..when current price crossing previous caldle..

RajuVgk

New Member
Joined
Mar 5, 2020
Messages
5
Likes
0
#1
i dont know, how to write code.. for below condition..

draw line.. where current candle price cross previous candle low or high...
 
Joined
May 27, 2013
Messages
2,237
Likes
6,595
Location
Here & Now :)
#2
Code:
PlotShapes(3*Cross(C,Ref(H,-1)),colorBlueGrey,0,L);
PlotShapes(4*Cross(Ref(L,-1),C),colorRed,0,H);
This will not give you any line but arrows when the condition is met


.
 

RajuVgk

New Member
Joined
Mar 5, 2020
Messages
5
Likes
0
#3
Thanks for help... iam trying to buy as same... but it shows error..can you correct ...
Y = (Cross(Ref(L,-1),C);
X = (Cross(C,Ref(H,-1));

Buy=Cover= (Cross(C,Ref(H,-1));
Sell=Short=(Cross(Ref(L,-1),C);

Filter = 1;
AddColumn(X,"X",1.4);
AddColumn(Y,"Y",1.4);

PlotShapes(3*Cross(C,Ref(H,-1)),colorBlueGrey,0,L);
PlotShapes(4*Cross(Ref(L,-1),C),colorRed,0,H);
 
Joined
May 27, 2013
Messages
2,237
Likes
6,595
Location
Here & Now :)
#5
Can i know, why you use, 3* and 4*
3 is for shape - hollow up arrow, 4 is down
replace with 1 & 2 for solid shapes, etc

for clean buy/sell use 4 ExRem statements
e.g.

Buy = Exrem(Buy, Sell);

Check the Amibroker Help for how to / why for every command, best place for learning, loads of examples




.
 
Joined
May 27, 2013
Messages
2,237
Likes
6,595
Location
Here & Now :)
#6
Thanks for help... iam trying to buy as same... but it shows error..can you correct ...
Y = (Cross(Ref(L,-1),C);
X = (Cross(C,Ref(H,-1));

Buy=Cover= (Cross(C,Ref(H,-1));
Sell=Short=(Cross(Ref(L,-1),C);

Filter = 1;
AddColumn(X,"X",1.4);
AddColumn(Y,"Y",1.4);

PlotShapes(3*Cross(C,Ref(H,-1)),colorBlueGrey,0,L);
PlotShapes(4*Cross(Ref(L,-1),C),colorRed,0,H);
Count the opening brackets and then count the closing ones, they should match na . . .


Try this
Code:
Y = Cross(Ref(L,-1),C);
X = Cross(C,Ref(H,-1));

Buy=Cover= Cross(C,Ref(H,-1));
Sell=Short=Cross(Ref(L,-1),C);

.
 

Similar threads

Broker Special Offers