Simple Coding Help - No Promise.

Please post a chart of the same to make it easier. Based on that, it can be easily created. :)
Thank you for your response Raj. I dont use this for charts, only for scanning which it provides now, but I am looking for exploration of the same, where I can add a few more parameters (yeah I learnt that now :). Your time is much appreciated. Responded at 10:50 AM, waiting Admin review :(.
 

Romeo1998

Well-Known Member
Hello @JediStar Sir :)
just add this to end of code :)
Code:
Filter = Buy OR Sell OR Short OR Cover;
AddColumn(IIf(Buy,BuyPrice,Null),"Buy",1.2);
AddColumn(IIf(Sell,SellPrice,Null),"Sell",1.2);
AddColumn(IIf(Short,ShortPrice,Null),"Short",1.2);
AddColumn(IIf(Cover,CoverPrice,Null),"Cover",1.2);
Best of Luck :)
 
Last edited:
Hello @checkmate7 Sir :)
Code:
a = TimeFrameGetPrice("V",in5Minute,0,expandLast);
b =  MA(TimeFrameGetPrice("V",in5Minute*6,0,expandLast),200);
Filter =  a > b AND a >= b*4; 
AddColumn(a,"5 min V");
AddColumn(b,"30 min avg V");
Best of Luck :)

Thank you so much Romeo, I was really hoping since Raj asked me certain questions he is going to help me out :-d.... but from no where you popped up helping me on time.... Much appreciate your time Sir ! I will check it out surely.
 
Romeo Bro,

In this AFL I see too many repetitions of the Symbol for the same signal. For e.g. Apollo Hospital I get a 1 under condition, but for every time interval this signal continues to appear. I would like to see the symbol again, only when the signal changes. To make it more clear, if Company X if I get a buy say at 9:45 PM, I would like to see the Company X again only when it changes to sell and likewise for sell condition. I am not sure if there is a sell condition included in this, but now that I am learning to understand AFL I will code that :).

As a general rule how to avoid repetition of the same symbol multiple times, say I am scanning in 5 minutes, and let us say I get a signal at 9:35 AM, and let us also say that around 12:05 the signal changed to sell, in most of the exploration AFLs, I see you will see the same symbol repeated till 12:05 flooding the entire exploration window which can be quite overwhelming. So would really appreciate this beginner to understand how to handle this.

Thank you so much for your time.

Admin : Could you kindly approve this a little early, as market is not there, would help me.
 
Sorry here is the AFL Code :

_SECTION_BEGIN("Moving Average Exploration");

MA20=MA(C, 20);
MA50=MA(C, 50);
MA100=MA(C,100);
MA200=MA(C,200);

condition = C>MA20 AND MA20>MA50 AND MA50>MA100 AND MA100>MA200;

AddColumn(Close, "Close", 1.2);
AddColumn(Volume, "Volume", 1.2);
AddColumn(MA(C, 9), "MA9");
AddColumn(MA(C, 20), "MA20");
AddColumn(MA(C, 50), "MA50");
AddColumn(MA(C, 100), "MA100");
AddColumn(MA(C, 200), "MA200");
AddColumn( condition, "Condition", 1.0);

Filter = 1;

_SECTION_END();
 

Romeo1998

Well-Known Member
@JediStar Sir
Code:
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = ExRem(Short,Cover);
Cover = ExRem(Cover,Short);
Filter = Buy OR Sell OR Short OR Cover;
AddColumn(IIf(Buy,BuyPrice,Null),"Buy",1.2);
AddColumn(IIf(Sell,SellPrice,Null),"Sell",1.2);
AddColumn(IIf(Short,ShortPrice,Null),"Short",1.2);
AddColumn(IIf(Cover,CoverPrice,Null),"Cover",1.2);
Best of Luck :)
 

checkmate7

Well-Known Member
Hello @checkmate7 Sir :)
Code:
a = TimeFrameGetPrice("V",in5Minute,0,expandLast);
b =  MA(TimeFrameGetPrice("V",in5Minute*6,0,expandLast),200);
Filter =  a > b AND a >= b*4; 
AddColumn(a,"5 min V");
AddColumn(b,"30 min avg V");
Best of Luck :)
Thanks Romeo :)
 
@JediStar Sir
Code:
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = ExRem(Short,Cover);
Cover = ExRem(Cover,Short);
Filter = Buy OR Sell OR Short OR Cover;
AddColumn(IIf(Buy,BuyPrice,Null),"Buy",1.2);
AddColumn(IIf(Sell,SellPrice,Null),"Sell",1.2);
AddColumn(IIf(Short,ShortPrice,Null),"Short",1.2);
AddColumn(IIf(Cover,CoverPrice,Null),"Cover",1.2);
Best of Luck :)

Thanks mate.

I getting errors in the first five lines bro. Variable 'buy' used without having been initialized. And same errors for the other four lines too.
 

Similar threads