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

RajuVgk

New Member
i dont know, how to write code.. for below condition..

draw line.. where current candle price cross previous candle low or high...

Happy_Singh

Happy
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
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));

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

Filter = 1;

PlotShapes(3*Cross(C,Ref(H,-1)),colorBlueGrey,0,L);
PlotShapes(4*Cross(Ref(L,-1),C),colorRed,0,H);

Happy_Singh

Happy
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.

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

.

Happy_Singh

Happy
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));

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

Filter = 1;

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));

Sell=Short=Cross(Ref(L,-1),C);``````

.

learnn

New Member
H1 = TimeFrameGetPrice("H", 2*inWeekly, -1);