Simple Coding Help - No Promise.

Nehal_s143

Well-Known Member
Heartly Thanks to Happy jee & Amit jee for your Kind Support :clapping:

I have done the changes & all is ok now instead of 3 minor things ...

1. When you make candles thick , after extended lines now it is showing extended bar chart along with candles . ( Resolved by not extending Today hi & lo ) :)

2 . Today high & low & also all lines like yesterday HLC , etc shifted for the same period of extended bars during that day . ( Resolved by rewrting on old formula which was having dual fields for Previous day HLC ) :)

3 . I need yesterday's open as well in afl if possible . Still Needed
Please use of code tag when using afl without space

[ c o d e ]

your afl code here

[ / c o d e ]
 

ajeetsingh

Well-Known Member
Better if you post AFL along with screen shot.Or have to search and dig out old AFL.
There is nothing as such to post.
In my image, there is plotting of price with some cosmetic changes, a 200 EMA and Fibonacci retracemnets whose code is posted here in this thread itself.
I just need code for fibonacci extensions in addition to retracements.
All Buys and Sells are taken manually...... Simple !!!
Please help me out for the same.
Thanks


got attracted by simplicity of your afl. what is the success ratio of your system?
As I take trades manually, so I cant backtest it with past quotes so Not possible for me to calculate success ratio as such.
I have already posted somewhere in this forum that my target is to earn 1% daily with minimal SL and I am achieving almost
so you can take this as my success ratio.
Thanks
 

amitrandive

Well-Known Member
Better if you post AFL along with screen shot.Or have to search and dig out old AFL.
There is nothing as such to post.
In my image, there is plotting of price with some cosmetic changes, a 200 EMA and Fibonacci retracemnets whose code is posted here in this thread itself.
I just need code for fibonacci extensions in addition to retracements.
All Buys and Sells are taken manually...... Simple !!!
Please help me out for the same.
Thanks
For anyone trying to help this request is not difficult , is it ????
Searching for the AFL and then modifying it ????
 

ajeetsingh

Well-Known Member
For anyone trying to help this request is not difficult , is it ????
Searching for the AFL and then modifying it ????
Here's the code for retracements and I need it for extensions.
Cant do this coding at my own.....
Thanks

Code:
_SECTION_BEGIN("Fibo");
FibCol= colorBlue ;
YH=TimeFrameGetPrice("H", inDaily, -1);
YL=TimeFrameGetPrice("L", inDaily, -1);

Yo=TimeFrameGetPrice("O", inDaily, -1);
Yc=TimeFrameGetPrice("C", inDaily, -1);

DD=Prec(C-Yc,2);
xx=Prec((DD/Yc)*100,2);


numbars = LastValue(Cum(Status("barvisible")));
hts = -120;
Today = LastValue(Day());
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);

Line0=YL;
Line100=YH;

Line1 = Line0 + abs(Line100-Line0)*0.236; 
Line2 = Line0 + abs(Line100-Line0)*0.382; 
Line3 = Line0 + abs(Line100-Line0)*0.5; 
Line4 = Line0 + abs(Line100-Line0)*0.618; 
Line5= Line0 + abs(Line100-Line0)*0.786; 


Plot(IIf(Today == Day(),YL,Null), "0%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line1,Null), "23.6%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line2,Null), "38.2%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line3,Null), "50%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line4,Null), "61.8%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line5,Null), "78.6%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),YH,Null), "100%",FibCol,styleDashed |styleNoRescale|styleNoTitle);

PlotText("0%= " + WriteVal(YL,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (YL,1) , FibCol);
PlotText("23.6%= " + WriteVal(Line1,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line1,1) , FibCol);
PlotText("38.2%=" + WriteVal(Line2,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line2,1) , FibCol);
PlotText("50%= " + WriteVal(Line3,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line3,1) , FibCol);
PlotText("61.8%= " + WriteVal(Line4,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line4,1) , FibCol);
PlotText("78.6%= " + WriteVal(Line5,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line5,1) , FibCol);
PlotText("100%= " + WriteVal(YH,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (YH,1) , FibCol);
_SECTION_END();
 

amitrandive

Well-Known Member
Here's the code for retracements and I need it for extensions.
Cant do this coding at my own.....
Thanks

Code:
_SECTION_BEGIN("Fibo");
FibCol= colorBlue ;
YH=TimeFrameGetPrice("H", inDaily, -1);
YL=TimeFrameGetPrice("L", inDaily, -1);

Yo=TimeFrameGetPrice("O", inDaily, -1);
Yc=TimeFrameGetPrice("C", inDaily, -1);

DD=Prec(C-Yc,2);
xx=Prec((DD/Yc)*100,2);


numbars = LastValue(Cum(Status("barvisible")));
hts = -120;
Today = LastValue(Day());
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);

Line0=YL;
Line100=YH;

Line1 = Line0 + abs(Line100-Line0)*0.236; 
Line2 = Line0 + abs(Line100-Line0)*0.382; 
Line3 = Line0 + abs(Line100-Line0)*0.5; 
Line4 = Line0 + abs(Line100-Line0)*0.618; 
Line5= Line0 + abs(Line100-Line0)*0.786; 


Plot(IIf(Today == Day(),YL,Null), "0%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line1,Null), "23.6%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line2,Null), "38.2%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line3,Null), "50%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line4,Null), "61.8%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line5,Null), "78.6%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),YH,Null), "100%",FibCol,styleDashed |styleNoRescale|styleNoTitle);

PlotText("0%= " + WriteVal(YL,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (YL,1) , FibCol);
PlotText("23.6%= " + WriteVal(Line1,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line1,1) , FibCol);
PlotText("38.2%=" + WriteVal(Line2,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line2,1) , FibCol);
PlotText("50%= " + WriteVal(Line3,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line3,1) , FibCol);
PlotText("61.8%= " + WriteVal(Line4,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line4,1) , FibCol);
PlotText("78.6%= " + WriteVal(Line5,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line5,1) , FibCol);
PlotText("100%= " + WriteVal(YH,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (YH,1) , FibCol);
_SECTION_END();
Which extension levels u want ?
 

amitrandive

Well-Known Member

Final code.Have coded the Ext line with red colour to distinguigh between the retracement and extension levels.

Code:
_SECTION_BEGIN("Price1");
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 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("Fibo");
FibCol= colorBlue ;
FibExt=colorRed;
YH=TimeFrameGetPrice("H", inDaily, -1);
YL=TimeFrameGetPrice("L", inDaily, -1);

Yo=TimeFrameGetPrice("O", inDaily, -1);
Yc=TimeFrameGetPrice("C", inDaily, -1);

DD=Prec(C-Yc,2);
xx=Prec((DD/Yc)*100,2);


numbars = LastValue(Cum(Status("barvisible")));
hts = -120;
Today = LastValue(Day());
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);

Line0=YL;
Line100=YH;

Line1 = Line0 + abs(Line100-Line0)*0.236; 
Line2 = Line0 + abs(Line100-Line0)*0.382; 
Line3 = Line0 + abs(Line100-Line0)*0.5; 
Line4 = Line0 + abs(Line100-Line0)*0.618; 
Line5= Line0 + abs(Line100-Line0)*0.786; 
Line6= Line0 + abs(Line100-Line0)*1.236; 
Line7= Line0 + abs(Line100-Line0)*1.382; 
Line8= Line0 + abs(Line100-Line0)*1.5;
Line9= Line0 + abs(Line100-Line0)*1.618;
Line10= Line0 + abs(Line100-Line0)*1.786;
Line11= Line0 + abs(Line100-Line0)*2;
Plot(IIf(Today == Day(),YL,Null), "0%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line1,Null), "23.6%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line2,Null), "38.2%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line3,Null), "50%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line4,Null), "61.8%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line5,Null), "78.6%",FibCol,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line6,Null), "23.6 %",FibExt,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line7,Null), "38.2%",FibExt,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line8,Null), "50%",FibExt,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line9,Null), "61.8%",FibExt,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line10,Null), "78.6 %",FibExt,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),Line11,Null), "100%",FibExt,styleDashed |styleNoRescale|styleNoTitle);
Plot(IIf(Today == Day(),YH,Null), "100%",FibCol,styleDashed |styleNoRescale|styleNoTitle);

PlotText("0%= " + WriteVal(YL,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (YL,1) , FibCol);
PlotText("23.6%= " + WriteVal(Line1,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line1,1) , FibCol);
PlotText("38.2%=" + WriteVal(Line2,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line2,1) , FibCol);
PlotText("50%= " + WriteVal(Line3,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line3,1) , FibCol);
PlotText("61.8%= " + WriteVal(Line4,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line4,1) , FibCol);
PlotText("78.6%= " + WriteVal(Line5,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line5,1) , FibCol);
PlotText("100%= " + WriteVal(YH,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (YH,1) , FibCol);
PlotText("23.6%= " + WriteVal(Line6,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line6,1) , FibExt);
PlotText("38.2%= " + WriteVal(Line7,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line7,1) , FibExt);
PlotText("50%= " + WriteVal(Line8,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line8,1) , FibExt);
PlotText("61.8%= " + WriteVal(Line9,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line9,1) , FibExt);
PlotText("78.6%= " + WriteVal(Line10,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line10,1) , FibExt);
PlotText("100%= " + WriteVal(Line11,fraction),LastValue(BarIndex())-(numbars/hts),LastValue (Line11,1) , FibExt);
_SECTION_END();
 

Similar threads