Simple Coding Help - No Promise.

And someone said it takes just a few minutes :D


Happy Singh

Can you please provide the complete scan? I get a message for variables not defined .

Thanks
Amit


You need to define the 4 MAs for different TFs

As he had posted only the chart and not his code, i just gave the code for scan

Maybe Manoj can post the complete code with MAs and Scan. . .



:) Happy
 

manojborle

Well-Known Member
And someone said it takes just a few minutes :D






You need to define the 4 MAs for different TFs

As he had posted only the chart and not his code, i just gave the code for scan

Maybe Manoj can post the complete code with MAs and Scan. . .



:) Happy
TimeFrameSet(in5Minute);
TF5min20EMA=EMA(C,20);
TimeFrameRestore();
TimeFrameExpand(TF5min20EMA, in5Minute, mode=expandFirst);

TimeFrameSet(in15Minute);
TF15min20EMA=EMA(C,20);
TimeFrameRestore();
TimeFrameExpand(TF15min20EMA, in15Minute, mode=expandFirst);

TimeFrameSet(30*in1Minute);
TF30min20EMA=EMA(C,20);
TimeFrameRestore();
TimeFrameExpand(TF30min20EMA, 30*in1Minute, mode=expandFirst);

TimeFrameSet(inHourly);
TF60min20EMA=EMA(C,20);
TimeFrameRestore();
TimeFrameExpand(TF60min20EMA, inHourly, mode=expandFirst);

highestEMA=
IIf((TF5min20EMA>=TF15min20EMA) AND
(TF5min20EMA>=TF30min20EMA) AND
(TF5min20EMA>=TF60min20EMA),
TF5min20EMA,
IIf((TF15min20EMA>=TF30min20EMA) AND
(TF15min20EMA>=TF60min20EMA),
TF15min20EMA,
IIf((TF30min20EMA>=TF60min20EMA),
TF30min20EMA,TF60min20EMA)));

lowestEMA=
IIf((TF5min20EMA<=TF15min20EMA) AND
(TF5min20EMA<=TF30min20EMA) AND
(TF5min20EMA<=TF60min20EMA),
TF5min20EMA,
IIf((TF15min20EMA<=TF30min20EMA) AND
(TF15min20EMA<=TF60min20EMA),
TF15min20EMA,
IIf((TF30min20EMA<=TF60min20EMA),
TF30min20EMA,TF60min20EMA)));

allEMAsNear=((lowestEMA*1.01)>=highestEMA); /* tweak this number
to find what works for the scrip */

Filter=allEMAsNear;

//AddColumn(lowestEMA,"L-ema");
//AddColumn(highestEMA,"H-ema");
AddColumn(TF5min20EMA,"5minTF-20ema");
AddColumn(TF15min20EMA,"15minTF-20ema");
AddColumn(TF30min20EMA,"30minTF-20ema");


Sir, this was the code Raghuveer has written, but It is not giving the desired result.

As mentioned in the code, the multiplication factor needs to be changed for every scrip.

I could not make changes in the code as I did not understand what to do.

I will try to incorporate your code and see if it gives the result what I am trying to achieve .

Thanks for the help sir.
 
Code:
TimeFrameSet(in5Minute);
ema5Min=EMA(C,20);
TimeFrameRestore();
EMA_5=TimeFrameExpand(ema5Min, in5Minute, mode=expandFirst);
Plot(EMA_5, "EMA_5_MIN", colorLime, styleThick);  	

TimeFrameSet(in15Minute);
ema15Min=EMA(C,20);
TimeFrameRestore();
EMA_15=TimeFrameExpand(ema15Min, in15Minute, mode=expandFirst);
Plot(EMA_15, "EMA_15_MIN", colorBlueGrey, styleThick);  	

TimeFrameSet(30*in1Minute);
ema30Min=EMA(C,20);
TimeFrameRestore();
EMA_30=TimeFrameExpand(ema30Min, 30*in1Minute, mode=expandFirst);
Plot(EMA_30, "EMA_30_MIN", colorRed, styleThick);  	

TimeFrameSet(inHourly);
ema60Min=EMA(C,20);
TimeFrameRestore();
EMA_60=TimeFrameExpand(ema60Min, inHourly, mode=expandFirst);
Plot(EMA_60, "EMA_60_MIN", colorBlue, styleThick);  	

P = Param("Points Difference", 5,0.5,25,0.5);
Filter = abs(EMA_5- EMA_15) < P AND abs(EMA_5- EMA_30) < P AND abs(EMA_5-EMA_60) < P AND 
         abs(EMA_15-EMA_30) < P AND abs(EMA_15-EMA_60) < P AND abs(EMA_30-EMA_60) < P;

AddColumn(EMA_5, "5minTF-20ema");
AddColumn(EMA_15,"15minTF-20ema");
AddColumn(EMA_30,"30minTF-20ema");
AddColumn(EMA_60,"60minTF-20ema");
Change Param to Adjust the gap, for nifty keep it 5-10 points for BNF can be 10-20 points etc . . .
 
Hello

Due to new commitments on my part and lack of time, I may not able to respond to all the queries posted here . . .

To avoid people getting annoyed, I request the moderators / Admin to please close this thread

It was fun trying to help in a small way.

When free will try to give AFL coding inputs to the queries on various threads but please start your own thread with your new queries.



:) Happy
................

Hello Gandhar

No problems even with that, either way . . . . I am Happy :)

I can understand when a person is facing a problem and posts here expecting a solution, would feel the frustration if they get no reply even after repeated polite reminders.

Just to avoid putting them in such a situation I have requested to close this thread, and not due to irritation or any that sort of feeling towards anyone.


I wish everyone finds the True Happiness, they are looking for :thumb:

:) Happy
 

VJAY

Well-Known Member
Dear happy singh,
As looks like thread still not closed...your PM too not active...so posting here and looking your help...:)
I need soundalert in supertrend afl when price trading above s/l point...sound alert need contineously OR in every 1 minute when price trading abv s/l ....
 
Hello,

I'm using below code in nest trader and it is showing good result for trading. I want to have an AFL so that I can use it in Amibroker.

BUY = EMA(CLOSE, 5) > SMA (CLOSE, 20) AND RSI (CLOSE, 21) < 40

SELL = EMA(CLOSE, 5) < SMA (CLOSE, 20) AND RSI (CLOSE, 21) > 60

BUY EXIT = RSI (CLOSE, 21) > 80
SELL EXIT = RSI (CLOSE, 21) < 30

===============
With 5 minute internal it is showing me below signal in Nest trader for nifty now.

10/24/2013 11:10 SHORT 6253.15
10/28/2013 13:55 EXIT SHORT 6114.25

I would greatly appreciate if someone can help me and create AFL which should show same result as mentioned above.

Thanks,
 

Similar threads