Simple Coding Help - No Promise.

Dear Experts,
I am very new to Amibroker and AFL coding so i would like to seek help from experts in AFL

My strategy will be BUY when MA3 crosses Over MA7 With SL of 1 rupee and Target profit of 5 rupees with trailing SL of 1 rupee
SELL when MA3 crosses Below MA7 with SL of ! rupee and Target profit of 5 rupees with trailing SL of 1 rupee

I would like to implement this startegy on equity futures on intraday basis
Thanks in advance
Kindly Help Me
 
Hello friends..
I need to SCAN the stocks whose RSI goes above or below 50, someone please help me to prepare an scan alert AFL for following conditions
1. Buy when RSI 10 goes above 50
2. Sell when RSI 10 goes below 50
I'm asking for an alert AFL so that I can scan all 210 fno stocks.
Thanks in anticipation.
 

VJAY

Well-Known Member
Dear friends,
If any one know the AFL code for showing lower tf EMA on higher tf chart ?Please share....
eg.I want to get 34 ema of 1TF on 3 tf chart.....
 

Snake.Head

Well-Known Member
Dear friends,
If any one know the AFL code for showing lower tf EMA on higher tf chart ?Please share....
eg.I want to get 34 ema of 1TF on 3 tf chart.....
Code:
_SECTION_BEGIN("34 EMA 1 MIN on 3 MIN");
TimeFrameSet(in1Minute);
m1= EMA(Close,34) ;
Plot(TimeFrameExpand(m1, in3Minute), "", ParamColor( "1 Min Color", colorGrey50 ), ParamStyle("Style", styleDashed));
TimeFrameRestore();
_SECTION_END();
 

VJAY

Well-Known Member
Code:
_SECTION_BEGIN("34 EMA 1 MIN on 3 MIN");
TimeFrameSet(in1Minute);
m1= EMA(Close,34) ;
Plot(TimeFrameExpand(m1, in3Minute), "", ParamColor( "1 Min Color", colorGrey50 ), ParamStyle("Style", styleDashed));
TimeFrameRestore();
_SECTION_END();
Thanks snake head...I am getting some error like this...

1536638964423.png
 

travi

Well-Known Member
Code:
_SECTION_BEGIN("34 EMA 1 MIN on 3 MIN");
TimeFrameSet(in1Minute);
m1= EMA(Close,34) ;
Plot(TimeFrameExpand(m1, in3Minute), "", ParamColor( "1 Min Color", colorGrey50 ), ParamStyle("Style", styleDashed));
TimeFrameRestore();
_SECTION_END();
I believe the TimeFrameRestore() is to be called before the plot,
and TimeFrameCompress() function is needed as Vjay says he needs a lower TF EMA on higher TF Chart.

1m data has to be compressed on a 3m chart.

all above theory still wont work, bcos,
Vjaybhai, if your chart is of 3m interval, from dropdown next to "Symbol", then you cannot access lower TF in AFL code in the whole chart.
This includes all its sheets and panes.

@VJAY you will need to redefine logic of what you need.

Eg. if chart interval is 1m, then you can plot Candlestick in 5m, and request 3m EMA on it.
OR
Chart Interval is 3m, request 3m EMA, and plot Candles in 5m.
any of these logic should work fine.
 

VJAY

Well-Known Member
I believe the TimeFrameRestore() is to be called before the plot,
and TimeFrameCompress() function is needed as Vjay says he needs a lower TF EMA on higher TF Chart.

1m data has to be compressed on a 3m chart.

all above theory still wont work, bcos,
Vjaybhai, if your chart is of 3m interval, from dropdown next to "Symbol", then you cannot access lower TF in AFL code in the whole chart.
This includes all its sheets and panes.

@VJAY you will need to redefine logic of what you need.

Eg. if chart interval is 1m, then you can plot Candlestick in 5m, and request 3m EMA on it.
OR
Chart Interval is 3m, request 3m EMA, and plot Candles in 5m.
any of these logic should work fine.
Dear travi bro,
am totally dumb in tech :) actually I want 34ema of 1m tf on 3m tf chart
 

Similar threads