Simple Coding Help - No Promise.

hello,
I am here again for some help.....
can we place multi-timeframe MA in amibroker.
like on 15 min chart I need 20sma of 15min,240min, and daily.
is this possible??
 
hello,
I am here again for some help.....
can we place multi-timeframe MA in amibroker.
like on 15 min chart I need 20sma of 15min, 240min, and daily.
is this possible??
Short answer Yes, can be done :thumb:


Happy :)
 
is there any build in option in amibroker or we have to code it because I have zero knowledge of coding so that will be the problem for me
Not built in but standard code available in help files . . .

check for functions

TimeFrameSet
TimeFrameRestore and
TimeFrameExpand


Happy :)
 
Not built in but standard code available in help files . . .

check for functions

TimeFrameSet
TimeFrameRestore and
TimeFrameExpand


Happy :)
hello,
I think this is code for normal SMA

_SECTION_BEGIN("MA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 800, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

so what should I add in this for a timeframe
 
Hi evryone,

I tried writing this small afl. where long trade is trigger on break of RE study and exit on ema cross and short trade triggered on SU study break and exit on ema cross.

This code shows trade signal correctly on 1st trigger for entry and exit, but doesnt show trade for further signals.

Experts plz have a look and point out the error , i will be grateful.

Thanks.

SU=Study("SU",GetChartID());
RE=Study("RE",GetChartID());

Short=Cross(SU,Close);
Cover=Cross(EMA(Close,20) ,EMA(Close,50));

Buy=Cross(Close,RE);
Sell=Cross(EMA(Close,50),EMA(Close,20));

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

Plot( EMA( Close,20 ),"EMA20",colorRed,styleLine);
Plot( EMA( Close,50 ),"EMA50",colorBlue,styleLine);

PlotShapes( IIf( Buy, shapeHollowSmallUpTriangle, shapeNone ), colorGreen, 0, BuyPrice );
PlotShapes( IIf( Sell, shapeHollowSmallDownTriangle, shapeNone ), colorRed, 0, SellPrice );

PlotShapes( IIf( Cover, shapeSmallUpTriangle, shapeNone ), colorGreen, 0, CoverPrice );
PlotShapes( IIf( Short, shapeSmallDownTriangle, shapeNone ), colorRed, 0, ShortPrice );
 
hello,
I think this is code for normal SMA

_SECTION_BEGIN("MA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 800, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

so what should I add in this for a timeframe
Did you read the Amibroker help files ???

Happy :)
 
Hi evryone,

I tried writing this small afl. where long trade is trigger on break of RE study and exit on ema cross and short trade triggered on SU study break and exit on ema cross.

This code shows trade signal correctly on 1st trigger for entry and exit, but doesnt show trade for further signals.

Experts plz have a look and point out the error , i will be grateful.

Thanks.
Code:
SU=Study("SU",GetChartID());
RE=Study("RE",GetChartID());

Short=Cross(SU,Close);
Cover=Cross(EMA(Close,20) ,EMA(Close,50));

Buy=Cross(Close,RE);
Sell=Cross(EMA(Close,50),EMA(Close,20));


PlotShapes(Buy*3, colorGreen, 0, L);
PlotShapes(Short*4, colorRed, 0, H);


Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

Plot( EMA( Close,20 ),"EMA20",colorRed,styleLine);
Plot( EMA( Close,50 ),"EMA50",colorBlue,styleLine);

PlotShapes( IIf( Buy, shapeHollowSmallUpTriangle, shapeNone ), colorGreen, 0, BuyPrice );
PlotShapes( IIf( Sell, shapeHollowSmallDownTriangle, shapeNone ), colorRed, 0, SellPrice );

PlotShapes( IIf( Cover, shapeSmallUpTriangle, shapeNone ), colorGreen, 0, CoverPrice );
PlotShapes( IIf( Short, shapeSmallDownTriangle, shapeNone ), colorRed, 0, ShortPrice );
Check if this is what you are looking for . . . .


Happy :)
 

Similar threads