Help Required

casoni

Well-Known Member
#11
Thank You Casoni for your efforts.
1.-macd fig -0.20 is not changing in parameter window. Please look into it.

Thanks again for all your efforts.

Regards
Debashish
ya,
repalce those lines with this

Bmacdzone=Param("BMacd lev",0.2,0,10,0.1);
Smacdzone=Param("SMacd lev",-0.2,-10,0,0.1);

Thank you
 

casoni

Well-Known Member
#13
Hi Casoni It is not changing from param window.

Regards
Debashish
oh silly mistake , my fault....
use this
Smacdzone= - Param("SMacd lev",0.2,0,10,0.1);

//=== corrected full code===
fma=Param("Fast ma",13,5,20,1);
sma=Param("Slow ma",26,5,30,1);
n=Param("Rsi per",14,7,20,1);
hbar=Param("Hold",2,1,5,1);
ema1=EMA(C,fma);
ema2=EMA(C,sma);
macd1=MACD();
rsi1=RSI(n);

Bmacdzone=Param("BMacd lev",0.2,0,10,0.1);
Smacdzone=-Param("SMacd lev",0.2,0,10,0.1);
Brsizone=Param("B rsi lev",40,20,65,1);
Srsizone=Param("S rsi lev",70,50,75,1);

maBuy=Cross(ema1,ema2);
macdbuy=(macd1>Bmacdzone);
rsibuy=(rsi1>Brsizone);

maShort=Cross(ema2,ema1);
macdshort= (macd1<Smacdzone) ;
rsishort= (rsi1<Srsizone);

Buy = mabuy AND ( macdbuy /*OR Hold(macdbuy,hbar)*/) AND (rsibuy OR Hold(rsibuy,hbar));
Sell= mashort AND ( macdshort /*OR Hold(macdshort,hbar)*/) AND (rsishort OR Hold(rsishort,hbar));

Plot(C,"",31,128);
Plot(ema1,"",5,1);
Plot(ema2,"",4,1);
PlotShapes(IIf(Buy, shapeStar, shapeNone),5, 0,L, Offset=-15);
PlotShapes(IIf(Sell, shapeStar, shapeNone),4, 0,H, Offset=15);
 
Last edited:

casoni

Well-Known Member
#15
Dear Casoni i have put - infront of smacd(in code) but it is not working from param window. The readings are0.01,0.02,0.03 etc.

Regards
Debashish


Hope you will understand by looking at the image

Bmacdzone=Param("BMacd lev",0.2,0,10,0.1);
Smacdzone=-Param("SMacd lev",0.2,0,10,0.1);
 
Last edited:
#16
Dear Casoni Bro, could you pls add buy/sell signal (for auto scan at amibroker) on ZERO level cross over up/buy then down/sell, thanks in advance for your hand, best regards.

_SECTION_BEGIN("KH_MACD");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack), colorLightGrey);

iOpt = ParamList("MACD Option", "Classic|MT4", 1);

cMACD = ParamColor("MACD Color", colorWhite);
cSig=ParamColor("Signal color", colorRed );



fastEMA = Param( "Fast EMA", 12, 1, 200, 1 );
slowEMA = Param( "Slow EMA", 26, 1, 200, 1 );
SigSMA = Param( "MACD SMA", 9, 1, 200, 1 );

iMACD=EMA(C, fastEMA) - EMA(C,slowEMA);
iSignal=MA(iMACD,SigSMA);

Plot( iSignal, "", cSig, styleThick|styleNoLabel);


_N(Title = StrFormat("MACD(%g, %g, %g) %g, %g", fastEMA, slowEMA, SigSMA, iMacd, iSignal));


switch (iOpt)
{
case "MT4":
Plot( iMACD, "", cMACD, styleThick|styleHistogram|styleNoLabel);
break;

default:
Plot( iMACD, "", cMACD, styleThick|styleNoLabel);
break;

}

Plot( 0, "", colorGrey40, styleNoLabel);
 
#17
this will do the job
how to make afl for following condition intraday 1 min chart.
high and low of every half an hour is recorded.
1. 9.15 to 9.45
2.9.46 to 10.15 and so on till mkt ends.
and buy aerrow is generated when current price cross PREVIOUS HALF AN HOUR HIGH.

and sell aerrow generated when current price cross PREVIOUS HALF AN HOUR
LOW.

all signals and time frame 1 min intraday.
 

casoni

Well-Known Member
#18
Dear Casoni Bro, could you pls add buy/sell signal (for auto scan at amibroker) on ZERO level cross over up/buy then down/sell, thanks in advance for your hand, best regards.

_SECTION_BEGIN("KH_MACD");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack), colorLightGrey);

iOpt = ParamList("MACD Option", "Classic|MT4", 1);

cMACD = ParamColor("MACD Color", colorWhite);
cSig=ParamColor("Signal color", colorRed );



fastEMA = Param( "Fast EMA", 12, 1, 200, 1 );
slowEMA = Param( "Slow EMA", 26, 1, 200, 1 );
SigSMA = Param( "MACD SMA", 9, 1, 200, 1 );

iMACD=EMA(C, fastEMA) - EMA(C,slowEMA);
iSignal=MA(iMACD,SigSMA);

Plot( iSignal, "", cSig, styleThick|styleNoLabel);


_N(Title = StrFormat("MACD(%g, %g, %g) %g, %g", fastEMA, slowEMA, SigSMA, iMacd, iSignal));


switch (iOpt)
{
case "MT4":
Plot( iMACD, "", cMACD, styleThick|styleHistogram|styleNoLabel);
break;

default:
Plot( iMACD, "", cMACD, styleThick|styleNoLabel);
break;

}

Plot( 0, "", colorGrey40, styleNoLabel);
buy=cross(iMACD,0);
sell=cross(0,iMACD);
 
#19
how to make afl for following condition intraday 1 min chart.
high and low of every half an hour is recorded.
1. 9.15 to 9.45
2.9.46 to 10.15 and so on till mkt ends.
and buy aerrow is generated when current price cross PREVIOUS HALF AN HOUR HIGH.

and sell aerrow generated when current price cross PREVIOUS HALF AN HOUR
LOW.

all signals and time frame 1 min intraday.
Reply With Quote
 

casoni

Well-Known Member
#20
Hello ,
Here,s how you can get HHV-LLV for selected time periods

below code will give you First session HHV-LLV [ 9:15 TO 9:45 ] timing are adjustable



copy and use for plotting 2nd ,3rd ,4th sessions

Hope this will be useful

//=========================================
_SECTION_BEGIN("1 session");
tn = TimeNum();
marketstart=ParamTime( "Market Start 1","9:15" );
etime1 = ParamTime( "End Time 1 ", "9:45" );
cond1 = (tn >= marketstart AND tn <= etime1) ;
firstBar1 = cond1 ;
firstBar1 = firstBar1- Ref( firstBar1, -1 );
xH1 = ValueWhen( cond1, HighestSince( firstBar1, High ) );
xL1 = ValueWhen( cond1, LowestSince( firstBar1, Low ) );
DH1 = TimeFrameCompress( xH1, inDaily, compressLast );
DL1 = TimeFrameCompress( xL1, inDaily, compressLast );
DH1 = TimeFrameExpand( DH1, inDaily, expandFirst );
DL1 = TimeFrameExpand( DL1, inDaily, expandFirst );
dh1a=IIf( cond1 , DH1, Null );
dl1a=IIf( cond1 , DL1, Null );
dh1b=IIf( tn >= etime1 , DH1, Null );
dl1b=IIf( tn >= etime1 , DL1, Null );
Plot( dh1a, "",colorPaleGreen,styleDashed);
Plot( dl1a, "",colorOrange,styleDashed);
Plot( dh1b, "",colorPaleGreen,styleLine);
Plot( dl1b, "",colorOrange,styleLine);
PlotOHLC(dh1a,dh1a,dl1a,dl1a,"",39,styleCloud|stylenolabel,0,0,0,-5);
_SECTION_END();


Plot(C,"",1,132);
nday = IIf(Day()!=Ref(Day(),-1),1,0);
Plot(nday,"",47,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);

SetChartOptions( 0, chartShowDates );
strWeekday = StrMid("SunMonTueWedThuFriSat", SelectedValue(DayOfWeek())*3,3);
Title = EncodeColor(colorWhite)+ "_ Sessions : " + Name() + " # " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" _ "+strWeekday +" _ "+ " # " + Date() + EncodeColor(colorLime) + StrFormat("\nO %g, H %g, L %g, C %g, V %g ", O, H, L, C, V )
+ EncodeColor(9) +
"\nMkt Start Time : "+ marketstart +
EncodeColor(13) +
"\n1st Session Ends : "+ etime1+
"\n1st HHV : "+ dh1b+ " # " +"1st LLV : "+ dL1b;

//=======================================
 

Similar threads