Simple Coding Help - No Promise.

Hi ,

I am new to trading after reading a lot on afl I have decided to buy amibroker software

Two question

1. Shall I buy amibroker pro or standard, is there limitation in standard ?
2. Do I need to buy directly through amibroker site or are there frenchise available

Thanks in advance

Mukesh

Last 2 weeks amibroker site is dead ... I dont know what is the reason...

 

bunti_k23

Well-Known Member
can any body plot linearray function on below formula for divergence finding or if any one have macd divergence afl code pls share

a=IIf(MACD()<0,-MACD(),0);
b=IIf(Signal()<0,-Signal(),0);

Plot(a,"",colorGreen,styleLine);
Plot(b,"",colorred,styleLine);
Buy=a>b;
Sell=b>a;
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed ) );
 
can any body plot linearray function on below formula for divergence finding or if any one have macd divergence afl code pls share

a=IIf(MACD()<0,-MACD(),0);
b=IIf(Signal()<0,-Signal(),0);

Plot(a,"",colorGreen,styleLine);
Plot(b,"",colorred,styleLine);
Buy=a>b;
Sell=b>a;
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed ) );
Plot(LineArray(bars-Offset, entry, BarCount, entry,1), "", colorYellow, styleLine|styleLine, Null, Null, Offset);
 
hi

I am a bit busy n one of my freind need a afl. Conditition is given below.

buy = macd()>signal() and pdi()>mdi();
bookp=buyprice+0.2;
sl=buyprice-0.2;
short=macd()<signal() and pdi()<mdi();
bookpp=shortprice-0.2;
sl=shortprice+0.2;

profit price n sl shud apper at screen and explorer.
 

bunti_k23

Well-Known Member
hi

I am a bit busy n one of my freind need a afl. Conditition is given below.

buy = macd()>signal() and pdi()>mdi();
bookp=buyprice+0.2;
sl=buyprice-0.2;
short=macd()<signal() and pdi()<mdi();
bookpp=shortprice-0.2;
sl=shortprice+0.2;

profit price n sl shud apper at screen and explorer.
:lol:i know this friend 2rs upar nikalna haibas:lol:
I think u shd try % target exit , usko diya tha ye pata nai aur kuch dusra chahiye shayad.here is the link.
http://www.traderji.com/amibroker/95300-sum-gud-afl-components-code.html
 

kumudhan

Well-Known Member


please refer the image above.
the afl for this is below.

_SECTION_BEGIN("BW Fractal");
UpFractal= ValueWhen(
(Ref(H,-2) > Ref(H, -4)) AND
(Ref(H,-2) > Ref(H, -3)) AND
(Ref(H,-2) > Ref(H, -1)) AND
(Ref(H,-2) > H), Ref(H,-2));
DownFractal= ValueWhen(
(Ref(L,-2) <= Ref(L, -4)) AND
(Ref(L,-2) <= Ref(L, -3)) AND
(Ref(L,-2) <= Ref(L, -1)) AND
(Ref(L,-2) <= L), Ref(L,-2));
//== Added Crash crashandburn59 [at] hotmail.com solution
Plot(Ref(UpFractal,2), "Up Fractal", ParamColor("Up Fractal Color",colorRed),
ParamStyle("Up Fractal Style", styleDashed));
Plot(Ref(DownFractal,2), "Down Fractal",ParamColor("Down Fractal
Color",colorBlue), ParamStyle("Down Fractal Style", styleDashed));
//Plot(Max(HHV(H,3),Ref(UpFractal,2)), "Up Fractal", ParamColor("Up Fractal Color",colorRed), ParamStyle("Up Fractal Style", styleDashed));
//Plot(Max(HHV(H,3),Ref(UpFractal,2)), "Down Fractal",ParamColor("Down FractalColor",colorBlue), ParamStyle("Down Fractal Style", styleDashed));
_SECTION_END();
Plot(C,"",colorWhite,styleCandle);
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
_SECTION_END();
_SECTION_BEGIN("MA");
Len = IIf(Interval() > 300, 30, 60);
Disp = WriteIf(Interval() > 300, "MA30", "MA60");
Av = MA(C, Len);
ColorShow = IIf(Av > Ref(Av,-1) AND C > Av, colorGreen, IIf(Av < Ref(Av,-1) AND C < Av, colorRed, colorBlue));
Plot(Av, Disp, ColorShow ,styleLine+styleDots,styleThick,styleDots);
_SECTION_END();
ToolTip = "High = " + H + "\nOpen = " + O + "\nRange = " + (High-Low) +"\nTRUERange = " + (C-O) +"\nMID ="+((High+Low)/2)+ "\nClose = " + C + "\nLow = " + L;
_SECTION_BEGIN("Title");
Title = "";
HoD = TimeFrameGetPrice("H",inDaily);
LoD = TimeFrameGetPrice("L",inDaily);
Rng = HoD - LoD;
Mid = LoD + Rng/2;
//Draw the Panel Box
GfxSelectPen( colorBlack,1 );
GfxMoveTo(2,2);
GfxLineTo(2,30);
GfxLineTo(1044,30);
GfxLineTo(1044,2);
GfxLineTo(2,2);
GfxMoveTo(140,2);
GfxLineTo(140,30);
GfxMoveTo(430,2);
GfxLineTo(430,30);
GfxMoveTo(530,2);
GfxLineTo(530,30);
GfxSelectFont("Comic Sans MS Bold", 9, 800);
GfxSetTextColor(colorBlack);
GfxDrawText(Name(), 10, 3, 77, 20,0);
GfxDrawText(NumToStr(Interval()/60,2.0) + " Min", 82, 3, 140, 20,0);
GfxSelectFont("Comic Sans MS Bold", 7, 800);
GfxDrawText(Date(), 10, 18, 140, 30,0);
GfxSelectFont("Comic Sans MS Bold", 10, 800);
GfxSetTextColor(colorBlue);
GfxDrawText(" HoD:" + NumToStr(HoD,3.0), 148, 7, 240, 30,0);
GfxSetTextColor(colorRed);
GfxDrawText(" LoD:" + NumToStr(LoD,3.0), 242, 7, 340, 30,0);
GfxSetTextColor(colorBlack);
GfxDrawText(" Mid:" + NumToStr(Mid,3.0), 342, 7, 500, 30,0);
GfxDrawText(" Range:" + NumToStr(Rng,3.0), 437, 7, 620, 30,0);
GfxDrawText("Open: " + NumToStr(O,3.0), 537, 7, 740, 30,0);
GfxSetTextColor(colorBlue);
GfxDrawText("Hi: " + NumToStr(H,3.0), 647, 7, 740, 30,0);
GfxSetTextColor(colorRed);
GfxDrawText("Lo: " + NumToStr(L,3.0), 740, 7, 860, 30,0);
GfxSetTextColor(colorBlack);
GfxDrawText("Close: " + NumToStr(C,3.0), 840, 7, 980, 30,0);
GfxSetTextColor(colorBlack);
GfxDrawText("Volume: " + NumToStr(V,3.0), 940, 7, 1080, 30,0);
_SECTION_END();
GfxSetOverlayMode(1);
GfxSelectFont("Comic Sans MS Bold", Status("pxheight")/15 );
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ColorRGB( 160, 160, 160 ) );
GfxSetTextColor( ColorHSB( 160, 0, 151 ) );
GfxSetBkMode(0); // transparent
GfxTextOut( "STOP YOUR LOSS", Status("pxwidth")/2, Status("pxheight")/3 );



now what i need is the line noted as 1 should be green in colour and thick and dotted as in line noted as 3
and line noted as 2 should be red in colour and thick and dotted as in line noted as 3.
these 2 lines should be permanent and need not be changed with parameters.
thank you in advance.
 

lvgandhi

Well-Known Member
I need help in drawing following lines.
1) If the last day is today and if the last visible day in the chart is, say 21/11/14, I would like a line drawn for high and low of 21/11/14
2) If the visible range in y-axis, say for Nifty future, is 8430 to 8550, lines are drawn for visible 50s and 100s ie in this case for 8450, 8500 and 8550.
Thanks in advance
 

Similar threads