Donchian Channel

#1
Respected All Members & Seniors

Pls modify the above afl........

_SECTION_BEGIN("Donchian Channel");

// Plots a 34 period <span class="h4dlw02vm" id="h4dlw02vm_6">Donchian channel</span>

pds=34;
DonchianUpper =HHV(Ref(H,-1),pds);
DonchianLower = LLV(Ref(L,-1),pds);
DonchianMiddle = (DonchianUpper+DonchianLower)/2;


Plot(DonchianUpper,"DU",colorBlue,styleLine);
Plot(DonchianMiddle,"DM",colorGreen,styleLine);
Plot(DonchianLower,"DL",colorRed,styleLine);
_SECTION_END();

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

PLEASE CHANGE THE ABOVE AFL WITH BELOW CODE......
****
BUY = CLOSE THE CANDLE ABOVE UPPER BLUE LINE
COVER = CLOSE THE CANDLE ABOVE MIDDLE GREEN LINE
SELL = CLOSE THE CANDLE BELOW LOWER RED LINE
COVER = CLOSE THE CANDLE ABOVE MIDDLE GREEN LINE
****
BUY
SELL
SHORT
COVER
*****

WARM REGARDS
CHINMAY
 
Last edited:

amitrandive

Well-Known Member
#2
Respected All Members & Seniors

Pls modify the above afl........

_SECTION_BEGIN("Donchian Channel");

// Plots a 34 period <span class="h4dlw02vm" id="h4dlw02vm_6">Donchian channel</span>

pds=34;
DonchianUpper =HHV(Ref(H,-1),pds);
DonchianLower = LLV(Ref(L,-1),pds);
DonchianMiddle = (DonchianUpper+DonchianLower)/2;


Plot(DonchianUpper,"DU",colorBlue,styleLine);
Plot(DonchianMiddle,"DM",colorGreen,styleLine);
Plot(DonchianLower,"DL",colorRed,styleLine);
_SECTION_END();

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

PLEASE CHANGE THE ABOVE AFL WITH BELOW CODE......
****
BUY = CLOSE THE CANDLE ABOVE UPPER BLUE LINE
COVER = CLOSE THE CANDLE ABOVE MIDDLE GREEN LINE
SELL = CLOSE THE CANDLE BELOW LOWER RED LINE
COVER = CLOSE THE CANDLE ABOVE MIDDLE GREEN LINE
****
BUY
SELL
SHORT
COVER
*****

WARM REGARDS
CHINMAY
Add these lines at the end of the code

Code:
Buy=Cross(C,DonchianUpper);
Sell=Cross(DonchianLower,C);
Cover=Cross(C,DonchianMiddle);
Cover1=Cross(DonchianMiddle,C);
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
shape1 = Cover * shapeUpTriangle;
Shape2=Cover1 * shapeDownTriangle;
 PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );
 PlotShapes( shape1, IIf(Cover, colorYellow,Null), 0, IIf( Cover,Low,Null) );
 PlotShapes( shape2, IIf(Cover1, colorAqua,Null), 0, IIf( Cover1,Low,Null) );
 
#4
RESPECTED AMIT SIR
THANKS A LOT ...AFL IS WORING GOOD
EXTREMLY SORYY FOR LATE REPLY
LAST 5/6 DAYS I am in my brothers wedding ceremony, thats why i cant reply u sir

THANKS AGAIN SIR

WARM REGARDS
CHINMAY

 
#5
please add exploration columns for DonchianUpper,DonchianLower and close price.
thanks
siva

Add these lines at the end of the code

Code:
Buy=Cross(C,DonchianUpper);
Sell=Cross(DonchianLower,C);
Cover=Cross(C,DonchianMiddle);
Cover1=Cross(DonchianMiddle,C);
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
shape1 = Cover * shapeUpTriangle;
Shape2=Cover1 * shapeDownTriangle;
 PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );
 PlotShapes( shape1, IIf(Cover, colorYellow,Null), 0, IIf( Cover,Low,Null) );
 PlotShapes( shape2, IIf(Cover1, colorAqua,Null), 0, IIf( Cover1,Low,Null) );
 
#6
Dear All, I'm newly joined to this forum and curious to know more about the performance of DONCHIAN strategy. I really appreciate all your feedback on this strategy and also would like to know if someone posted the entry/exit levels indicator for MT4 & AFL. Thanks again for all your time and support. I wish you all the best :)
 

bunti_k23

Well-Known Member
#7
Dear All, I'm newly joined to this forum and curious to know more about the performance of DONCHIAN strategy. I really appreciate all your feedback on this strategy and also would like to know if someone posted the entry/exit levels indicator for MT4 & AFL. Thanks again for all your time and support. I wish you all the best :)[/QUOTE


Take a look @ turtle trading system.....
http://www.traderji.com/amibroker/95374-backtesting-help.html

And also google double donchian channel system made by rajendran r...gud luck.
 

bunti_k23

Well-Known Member
#8
Respected All Members & Seniors

Pls modify the above afl........

_SECTION_BEGIN("Donchian Channel");

// Plots a 34 period <span class="h4dlw02vm" id="h4dlw02vm_6">Donchian channel</span>

pds=34;
DonchianUpper =HHV(Ref(H,-1),pds);
DonchianLower = LLV(Ref(L,-1),pds);
DonchianMiddle = (DonchianUpper+DonchianLower)/2;


Plot(DonchianUpper,"DU",colorBlue,styleLine);
Plot(DonchianMiddle,"DM",colorGreen,styleLine);
Plot(DonchianLower,"DL",colorRed,styleLine);
_SECTION_END();

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

PLEASE CHANGE THE ABOVE AFL WITH BELOW CODE......
****
BUY = CLOSE THE CANDLE ABOVE UPPER BLUE LINE
COVER = CLOSE THE CANDLE ABOVE MIDDLE GREEN LINE
SELL = CLOSE THE CANDLE BELOW LOWER RED LINE
COVER = CLOSE THE CANDLE ABOVE MIDDLE GREEN LINE
****
BUY
SELL
SHORT
COVER
*****

WARM REGARDS
CHINMAY
Dear chinmay, pls tell me why period 34 for donchian channel have u researched sum thin on that iam also working on turtle trading system.
 

Similar threads