Gann strategy...

#31
Can anyone please help me out on an issue, i have been trying to backtest a strategy afl for intraday but i cannot see any option to change periodicity to 5mins or 15mins in the back testing settings, Only daily-yearly.

Please check picture.
 
#32
Hey guys, also check out this afl, it is also vwap based gann. It shows all the target levels, S/L's and Buy/Sell signals.


_SECTION_BEGIN("Title");
SetChartOptions(0,chartShowArrows|chartShowDates,colorRed);


Plot(C,"Price",IIf(C>O,colorBrightGreen,colorBrown ),styleCandle);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L,C, SelectedValue( ROC( C, 1 )) ));


_SECTION_END();

_SECTION_BEGIN("GaNN Square of Nine");

BarsToday = 1 + BarsSince( Day() != Ref(Day(), -1));

StartBar = ValueWhen(TimeNum() == 091500, BarIndex());

TodayVolume = Sum(V,BarsToday);

VWAP = (Sum (((C+O+H+L)/4) * V, BarsToday ) / TodayVolume);
Plot (VWAP,"VWAP",colorBlue, styleStaircase = 512);


RefVWAP = ValueWhen(TimeNum() == 092900, Vwap,1);


BaseNum = (int(sqrt(RefVWAP))-1);
sBelow = BaseNum + BaseNum;
sBelowI = 1;


//Calculate levels for GANN Square of Nine

for( i = 1; i < 50; i++ )
{
VarSet( "GANN"+i, (BaseNum * BaseNum) );
BaseNum = BaseNum + 0.125;
sBelowI = IIf( VarGet("GANN"+i)< RefVWAP, i, sBelowI);
bAboveI = sBelowI + 1;
sBelow = round(VarGet("GANN"+sBelowI));
bAbove = round(VarGet("GANN"+bAboveI));
}

// Resistance Levels (or Targets for Buy trade)
BTgt1 = round(0.9995 * VarGet("Gann"+(bAboveI+1)));
BTgt2 = round(0.9995 * VarGet("Gann"+(bAboveI+2)));
BTgt3 = round(0.9995 * VarGet("Gann"+(bAboveI+3)));
BTgt4 = round(0.9995 * VarGet("Gann"+(baboveI+4)));
BTgt5 = round(0.9995 * VarGet("Gann"+(bAboveI+5)));
BTgt6 = round(0.9995 * VarGet("Gann"+(baboveI+6)));
// Support Levels (or Targets for Short trade)
STgt1 = round(1.0005 * VarGet("Gann"+(sBelowI-1)));
STgt2 = round(1.0005 * VarGet("Gann"+(sBelowI-2)));
STgt3 = round(1.0005 * VarGet("Gann"+(sBelowI-3)));
STgt4 = round(1.0005 * VarGet("Gann"+(sbelowI-4)));
STgt5 = round(1.0005 * VarGet("Gann"+(sBelowI-5)));
STgt6 = round(1.0005 * VarGet("Gann"+(sBelowI-6)));

Sstop= round(babove-((babove-sbelow)/3)) ;
Bstop= round(sbelow+((babove-sbelow)/3)) ;

BuySignal = TimeNum()>092900 AND (Cross(H,babove)OR Cross(C,babove) OR (H>babove AND L<=babove)) AND VWAP<babove ;
ShortSignal = TimeNum()>092900 AND (Cross(Sbelow,L) OR Cross(Sbelow,C) OR (H>=sbelow AND L<sbelow))AND VWAP>sbelow ;

BuySignal = ExRem(BuySignal,ShortSignal);
ShortSignal = ExRem(ShortSignal,BuySignal);

ShortProfitStop= (STgt1 AND L<=Stgt1 AND C>Stgt1) OR (STgt2 AND L<=Stgt2 AND C>Stgt2) OR (STgt3 AND L<=Stgt3 AND C>Stgt3) OR (STgt4 AND L<=Stgt4 AND C>Stgt4) OR (STgt5 AND L<=Stgt5 AND C>Stgt5) OR (STgt6 AND L<=Stgt6 AND C>Stgt6);

BuyProfitStop= (Btgt1 AND H>=btgt1 AND C<Btgt1) OR (Btgt2 AND H>=Btgt2 AND C<btgt2) OR (Btgt3 AND H>=Btgt3 AND C<btgt3) OR (Btgt4 AND H>=Btgt4 AND C<btgt4) OR (Btgt5 AND H>=Btgt5 AND C<btgt5) OR (Btgt6 AND H>=Btgt6 AND C<btgt6);

SetOption("MaxOpenPositions", 1 );
SetPositionSize(100,spsShares);

Buy = BuySignal;
Sell = C<Bstop OR BuyProfitStop;
Short = ShortSignal;
Cover = C>SStop OR ShortProfitStop;

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



Sstop= round(babove-((babove-sbelow)/3)) ;
Bstop= round(sbelow+((babove-sbelow)/3)) ;

GfxSetBkMode( 1 );
GfxSelectFont("Courier New", 11, 700 );
GfxSetTextColor( colorBrightGreen );
GfxSelectPen( colorBlack, 1, 0) ;
GfxSelectSolidBrush( colorWhite );

BTgtext = "Buy Targets : " + NumToStr(btgt1,1.2,False) + " - " + NumToStr(btgt2,1.2,False) + " - " + NumToStr(btgt3,1.2,False);
STgtext = "Short Targets : " + NumToStr(stgt1,1.2,False) + " - " + NumToStr(stgt2,1.2) + " - " + NumToStr(stgt3,1.2,False);

GfxTextOut("Current time : " + TimeNum(), 225, 25);

GfxTextOut("Buy Above : " + WriteIf(TimeNum()>092900, NumToStr(bAbove,1.2,False) + " SL : " + NumToStr(sBelow,1.2,False),"Waiting for Signal"), 225, 45);
GfxTextOut(WriteIf(TimeNum()>092900,BTgtext,""), 225, 55);

GfxSetBkMode( 1 );
GfxSelectFont("courier new", 11, 700 );
GfxSetTextColor( colorRed );
GfxSelectPen( colorBlack, 1, 0) ;
GfxSelectSolidBrush( colorWhite );

GfxTextOut("Short Below : " + WriteIf(TimeNum()>092900, NumToStr(sBelow,1.2,False) + " SL : " + NumToStr(bAbove,1.2,False),"Waiting for Signal"), 225, 75);
GfxTextOut(WriteIf(TimeNum()>092900,STgtext,""), 225, 85);

AddColumn(Close,"Close",1.4);
AddColumn(Buysignal,"buysignal",1.2);


_SECTION_BEGIN("BBands");
Plot(BBandTop(C,20,2),"",colorLightGrey,style=styleLine|styleNoRescale|styleNoLabel);
Plot(BBandBot(C,20,2),"",colorLightGrey,style=styleLine|styleNoLabel);
_SECTION_END();

Plot(sstop,"",colorGreen,styleDots=8|styleNoLabel) ;
Plot(bstop,"",colorRed,styleDots=8|styleNoLabel);
PlotOHLC( babove, sbelow, babove,sbelow, "", colorYellow, styleCloud);
PlotOHLC( sbelow, babove, sbelow,babove, "", colorYellow, styleCloud);




PlotShapes(IIf(Buysignal, shapeSquare, shapeNone),colorBlue, 0, L, Offset=-20);
PlotShapes(IIf(Buysignal, shapeSquare, shapeNone),colorBlue, 0,L, Offset=-30);
PlotShapes(IIf(Buysignal, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-25);

PlotShapes(IIf(Shortsignal, shapeSquare, shapeNone),colorRed, 0, H, Offset=20);
PlotShapes(IIf(Shortsignal, shapeSquare, shapeNone),colorOrange, 0,H, Offset=30);
PlotShapes(IIf(Shortsignal, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-25);

Plot(BTgt1,"",colorGreen,styleStaircase|styleSwingDots|styleNoRescale);
Plot(BTgt2,"",colorGreen,styleStaircase|styleSwingDots|styleNoRescale);
Plot(BTgt3,"",colorGreen,styleStaircase|styleSwingDots|styleNoRescale);
Plot(BTgt4,"",colorGreen,styleStaircase|styleSwingDots|styleNoRescale);
Plot(BTgt5,"",colorGreen,styleStaircase|styleSwingDots|styleNoRescale);
Plot(BTgt6,"",colorGreen,styleStaircase|styleSwingDots|styleNoRescale);

Plot(STgt1,"",colorRed,styleStaircase|styleSwingDots|styleNoRescale);
Plot(STgt2,"",colorRed,styleStaircase|styleSwingDots|styleNoRescale);
Plot(STgt3,"",colorRed,styleStaircase|styleSwingDots|styleNoRescale);
Plot(STgt4,"",colorRed,styleStaircase|styleSwingDots|styleNoRescale);
Plot(STgt5,"",colorRed,styleStaircase|styleSwingDots|styleNoRescale);
Plot(STgt6,"",colorRed,styleStaircase|styleSwingDots|styleNoRescale);


PlotShapes(IIf(Cover, shapeHollowUpArrow,shapeNone),colorGreen, 0, Low, Offset=-20);
PlotShapes(IIf(Sell, shapeHollowDownArrow,shapeNone),colorRed, 0, High, Offset=-20);

_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 update the backtesting results, I am having problems with backtesting intraday.
 

lvgandhi

Well-Known Member
#33
above afl gives buy values less than current price as shown in attached pic.
 
#34
Sir actually it takes vwap price and place the buy/sell signal after 9:30. There was a big movement in the last candle, the vwap was left behind, that is the reason for the problem. Try it on some other day data, I am sure it will give the right results.

I prefer to use 9:30 closing to find out gann levels, it seems to work better for me but I couldn't find any afl for that.
 
#36
Hiiii all...

Hope dat every 1 knows about this strategy.......I am using this strategy from last 1 month....my success ratio is around 80%......but I am not sure wheather it should continue or not.....If ny 1 using this strategy then plz share....

also share ny other intraday strategy
Hi buddy,

Are you sure that Gann strategy is an absolutely perfect for an intraday trading?
 
#38
hi
first thing
step one is
study and experiment

I got nothing to study. what to study?

what to study?
study the e book
pattern price time

where available?
over the net
PATTERN = ANY PATTERN LIKE DOUBLE TOP,DOUBLE BOTTOM etc
price = pure price
time= historic and future

GANN ANGLES GANN FANS,gann square all available as tools in amibroker
ARE THE STEP1 after you get the basic concept of Gann.
study =for period of 6 months
good luck

HERE IS GANN SQUARE OF NINE ROADMAP (AFL)BY LAL
---------------------------------------------------------------------------
/*
Formula Name: Square of Nine Roadmap Charts
Author/Uploader: Lal - (email hidden)
Date/Time added: 2008-03-30 14:19:07
Origin:
Keywords: Square of Nine, Roadmap
Level: semi-advanced
Flags: indicator

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users AND are provided here on an "as is" AND "as available" basis. AmiBroker.com makes no representations OR warranties of any kind to the contents OR the operation of material presented here. We do NOT maintain nor provide technical support for 3rd party formulas.
Description:

Produces automatic trend channels based on a SINGLE bar.
Formula:

cODER LAL SAYS
Here's a fix for the "endless loop..." problem reported by Embasy.

Replace the line:

"while(Next_Vertical < BarCount)"

with:

"while(Next_Vertical < BarCount AND SelectedValue(Vertical) > 1)"

(drop the quotes while copying!)

There are two occurences of the while loop. So make sure you replace both.


*/


/******************************************************************************************
Name : Square of Nine - Roadmap Charts (Amibroker implementation)
Coded by : Lal
Date : 27th March 2008
Note : Grateful thanks to Peter Amaral of Tradingfives.com
To gain an understanding of how these roadmap channels
work, read the article here:

http://www.tradingfives.com/square-of-nine-in-excel.htm

Thanks also to wavemechanic for his inputs.

Used properly, on the basis of a SINGLE bar, Roadmap Charts
will produce channels that will pretty much define the overall
future trend that can last anything from days to months or beyond.

To use, select the bar that you suspect to be a possible high or low.
Decide whether you want a bearish or a bullish channel. Next choose
an appropriate "Factor" (try starting with a value of 1) and a
"Multiplier."
For tickers that are greater than 3 digits, you may try a Multiplier
value of 0.10 and those below 3 digits, a value of 10. Tickers with
with just 3 digits, leave the Multiplier at 1. However, there are no
absolute
rules here and experimentation is strongly encouraged.

The Horizontal lines are support/resistance lines while the vertical lines
are timing lines.

All the lines plotted by this script can extend beyond the last bar. So
make sure
you have enough blank bars in the right margin (set by Preferences).
***************************************************************************************************/

_SECTION_BEGIN("So9_Params");
Base_Factor = ParamList("Factor",
"0.015625|0.03125|0.0625|0.1250|0.1875|0.2500|0.3125|0.3750|0.4375|0.5|0.5625|0.6250|0.6875|0.8125|0.8750|0.9375|1.0|1.250|1.5|1.75|2.0|2.5|3.0|4.0",
16);
Multiplier = ParamList("Multiplier", "0.001|0.01|0.10|1|10|100|1000|10000",
3);
Auto_Price = ParamToggle("Auto-select Price field?", "No|Yes", 1);
Price_Field = ParamField("Use ");
Max_Hor_Lines = Param("Max Hor. Lines", 10, 2, 100, 1);
Plot_Half_Lines = ParamToggle("Hor. HalfLines?", "No|Yes");
Extend_Bars = Param("Extend Plot by", 20, 0, 50, 1);
Channel_Type = ParamList("Channel Type", "Bullish|Bearish|None", 0);
Max_Chanl_Lines = Param("Max Channel Lines", 3, 1, 20, 1);
Show_Degrees = ParamToggle("Show Degrees?", "No|Yes", 1);
_SECTION_END();

_SECTION_BEGIN("Line Colours");
Bull_Line_Color = ParamColor("Bullish Horizontals", colorDarkGreen);
Bull_Half_Color = ParamColor("Bullish Horizontal Halfs", colorRed);
Bull_Vert_Color = ParamColor("Bullish Verticals", colorGrey50);
Bull_Chanl_Color = ParamColor("Bullish Channels", colorDarkGreen);

Bear_Line_Color = ParamColor("Bearish Horizontals", colorRed);
Bear_Half_Color = ParamColor("Bearish Horizontal Halfs", colorDarkGreen);
Bear_Vert_Color = ParamColor("Bearish Verticals", colorGrey50);
Bear_Chanl_Color = ParamColor("Bearish Channels", colorRed);
_SECTION_END();

SetChartBkGradientFill( ParamColor("BgTop", colorTeal),ParamColor("BgBottom",
colorLightGrey));
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() );
SetBarsRequired(100000, 100000);

EnableTextOutput(False);

// Convert list-type parameters to numbers
Base_Factor_N = StrToNum(Base_Factor);
Multiplier_N = StrToNum(Multiplier);

Vertical = 0;

// Display various bits of info. in Interpretation window
printf("\nSquare of Nine Roadmap Channels\n");
printf("-----------------------------------------\n");
if(Channel_Type == "Bullish")
printf("Channel Type: Bullish\n");
if(Channel_Type == "Bearish")
printf("Channel Type: Bearish\n");
if(Channel_Type == "None")
printf("Channel Type: NONE\n");
printf("Factor : %g\n", Base_Factor_N);
printf("Multiplier: %g\n", Multiplier_N);
printf("Origin Bar: %g\n", SelectedValue(BarIndex()));

// Plot Bullish Channels with horizontal Support/Resistance
if(Channel_Type == "Bullish")
{
// Select price for pivot low
if(Auto_Price == 1)
{
Price_Field = L;
}

Bull_Hor_A[0] = SelectedValue(Price_field); // 1st Horizontal is drawn from the current bar

for(i = 1; i <= Max_Hor_Lines-1; i++)
{

Bull_Hor = ( sqrt(Price_Field * Multiplier_N) + (Base_Factor_N * i)) ^2;
Degrees = 180 * Base_Factor_N * i;
Bull_Hor = Bull_Hor/Multiplier_N; // Put value back to pre-multiplication for plotting

Start_Bar = SelectedValue(BarIndex());
Start_Y = SelectedValue(Bull_Hor);
End_Bar = BarCount - 1;
End_Y = Start_Y;
Hor_Plot = LineArray(Start_Bar - Extend_Bars, Start_Y, End_Bar, End_Y, 1);

Plot(Hor_Plot, "", Bull_Line_Color, styleLine|styleNoRescale, Null, Null,Extend_Bars);

if(Show_Degrees)
{
PlotText("" + NumToStr(Degrees, 4, 1) + "", Start_bar+2, Start_Y + 1 ,colorBlack);
}

if(i == 1)
{
// Plot the 1st Horizontal. This is a one-time execution.
Plot(LineArray(Start_Bar - Extend_Bars, SelectedValue(Price_Field), End_Bar,
SelectedValue(Price_Field), 0), "", Bull_Line_Color, styleLine|styleNoRescale,
Null, Null, Extend_Bars);
}

Bull_Hor_A = SelectedValue(Bull_Hor); // Store the next horizontal value

// Plot the half-level horizontals conditionally
if(Plot_Half_Lines)
{
Bull_Hor = (Bull_Hor_A[i-1] + Bull_Hor_A)/2;
Start_Bar = SelectedValue(BarIndex());
Start_Y = SelectedValue(Bull_Hor);
End_Bar = BarCount - 1;
End_Y = Start_Y;
Hor_Plot = LineArray(Start_Bar - Extend_Bars, Start_Y, End_Bar, End_Y, 1);
Plot(Hor_Plot, "", Bull_Half_Color, styleLine|styleNoRescale, Null, Null,Extend_Bars);
}

} // End loop for plotting horizontal lines

// Plot Vertical Lines
Vertical = round(sqrt(Price_Field * Multiplier_N));
Next_Vertical = SelectedValue(BarIndex() ) + Vertical;
Plot(IIf(BarIndex() >= SelectedValue(BarIndex( )),
(Cum(1)-SelectedValue(BarIndex()) - 1)%SelectedValue(Vertical) == 0, Null), "",
Bull_Vert_Color, styleHistogram| styleOwnScale|styleNoLabel);

// DIsplay timing info
printf("Timing Interval: %g\n", Vertical);

// Logic to plot at least one vertical bar BEYOND Barcount()
Next_Vertical = SelectedValue(BarIndex()) +SelectedValue( Vertical);
//while(Next_Vertical < BarCount)//CORRECT THIS LINE USE NEXT LINE
while(Next_Vertical < BarCount AND SelectedValue(Vertical) > 1)
{
Next_Vertical = Next_Vertical + SelectedValue(Vertical);
}

// Work out how many bars to shift the vertical to the right from current selected bar
Shift = Next_Vertical[0] - SelectedValue(BarIndex());
Line1 = BarIndex() == SelectedValue(BarIndex()); // are we at current bar?
Plot(Line1,"", colorRed, styleHistogram| styleOwnScale, Null, Null, Shift) ;
// Plot vertical with a forward shift

// Plot channel lines
for(a = 0; a <= Max_Chanl_Lines - 1; a++)
{
Start_Bar = SelectedValue(BarIndex()) - Extend_Bars;
Start_Y = Bull_Hor_A[a];
End_Bar = Start_Bar + SelectedValue(Vertical);
End_Y = Bull_Hor_A[a+1];
Channel_Line = LineArray(Start_Bar - 0, Start_Y, End_Bar, End_Y, 1);
Plot(Channel_line, "", Bull_Chanl_Color,
styleLine|styleNoRescale|styleNoLabel, Null, Null, Extend_Bars);
}
}

// Plot Bearish Channels with horizontal Support/Resistance
if(Channel_Type == "Bearish")
{
// Select price for pivot high
if(Auto_Price == 1)
{
Price_Field = H;
}

Bear_Hor_A[0] = SelectedValue(Price_field); // 1st Horizontal is drawn from the current bar

for(i = 1; i <= Max_Hor_Lines-1; i++)
{
Bear_Hor = ( sqrt(Price_Field * Multiplier_N) - (Base_Factor_N * i)) ^2;
Degrees = 180 * Base_Factor_N * i;
Bear_Hor = Bear_Hor/Multiplier_N; // Put value back to pre-multiplication for plotting

Start_Bar = SelectedValue(BarIndex());
Start_Y = SelectedValue(Bear_Hor);
End_Bar = BarCount - 1;
End_Y = Start_Y;
Hor_Plot = LineArray(Start_Bar - Extend_Bars, Start_Y, End_Bar, End_Y, 1);

Plot(Hor_Plot, "", Bear_Line_Color, styleLine|styleNoRescale, Null, Null,Extend_Bars);

if(Show_Degrees)
{
PlotText("" + NumToStr(Degrees, 4, 1) + "", Start_bar+2, Start_Y + 1 ,colorBlack);
}

if(i == 1)
{
// Plot the 1st Horizontal. This is a one-time execution.
Plot(LineArray(Start_Bar - Extend_Bars, SelectedValue(Price_Field), End_Bar,
SelectedValue(Price_Field), 0), "", Bear_Line_Color,styleLine|styleThick|styleNoRescale, Null, Null, Extend_Bars);
}

Bear_Hor_A = SelectedValue(Bear_Hor); // Store the next horizontal value

// Plot the half-level horizontals if asked
if(Plot_Half_Lines)
{
Bear_Hor = (Bear_Hor_A[i-1] + Bear_Hor_A)/2;
Start_Bar = SelectedValue(BarIndex());
Start_Y = SelectedValue(Bear_Hor);
End_Bar = BarCount - 1;
End_Y = Start_Y;
Hor_Plot = LineArray(Start_Bar - Extend_Bars, Start_Y, End_Bar, End_Y, 1);
Plot(Hor_Plot, "", Bear_Half_Color, styleLine|styleNoRescale, Null, Null,Extend_Bars);
}

}

// Plot Vertical Lines
Vertical = round(sqrt(Price_Field * Multiplier_N));
Next_Vertical = SelectedValue(BarIndex()) + Vertical;
Plot(IIf(BarIndex() >= SelectedValue(BarIndex( )),
(Cum(1)-SelectedValue(BarIndex())-1)%SelectedValue(Vertical) == 0, Null), "",
Bear_Vert_Color, styleHistogram| styleOwnScale|styleNoLabel) ;

// DIsplay timing info
printf("Timing Interval: %g\n", Vertical);

// Logic to plot at least one vertical bar BEYOND Barcount()
Next_Vertical = SelectedValue(BarIndex()) +SelectedValue( Vertical);
//while(Next_Vertical < BarCount)//CORRECT THIS LINE
while(Next_Vertical < BarCount AND SelectedValue(Vertical) > 1)
{
Next_Vertical = Next_Vertical + SelectedValue(Vertical);
}

// Work out how many bars to shift the vertical to the right from current selected bar
Shift = Next_Vertical[0] - SelectedValue(BarIndex());
Line1 = BarIndex() == SelectedValue(BarIndex()); // are we at current bar?
Plot(Line1,"", colorDarkGreen, styleHistogram| styleOwnScale|styleNoLabel,
Null, Null, Shift) ; // Plot vertical with a forward shift

// Plot channel lines
//Extend_Bars = 0;
for(a = 0; a <= Max_Chanl_Lines - 1; a++)
{
Start_Bar = SelectedValue(BarIndex()) - Extend_Bars;
Start_Y = Bear_Hor_A[a];
End_Bar = Start_Bar + SelectedValue(Vertical);
End_Y = Bear_Hor_A[a+1];
Channel_Line = LineArray(Start_Bar - 0, Start_Y, End_Bar, End_Y, 1);
Plot(Channel_line, "", Bear_Chanl_Color,
styleLine|styleNoRescale|styleNoLabel, Null, Null, Extend_Bars);
}

} // End bearish channels

Channel_Bull_Text = WriteIf(Channel_Type == "Bullish", "Bullish", "" );
Channel_Bear_Text = WriteIf(Channel_Type == "Bearish", "Bearish", "");
Channel_Null_Text = "";

Price_Info = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g,
Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) );

Title = EncodeColor(colorBlack) + Price_Info + "\n" +
EncodeColor(colorBlack) + "Channel Type: " +
EncodeColor(colorBlue) + Channel_Bull_Text +
EncodeColor(colorRed) + Channel_Bear_Text +
EncodeColor(colorBlack) + Channel_Null_Text + "\n" +
EncodeColor(colorBlack) + "Factor: " + EncodeColor(colorBlue) + Base_Factor
+ "\n" +
EncodeColor(colorBlack) + "Multiplier: " + EncodeColor(colorDarkGreen) +Multiplier_N + "\n" +
EncodeColor(colorBlack) + "Origin Bar: " + EncodeColor(colorYellow) +SelectedValue(BarIndex()) + "\n" +
EncodeColor(colorBlack) + "Timing Interval: " + EncodeColor(colorDarkBlue)+ Vertical;

-------------------------------------------------------------------------------------------------------------------------
TRY EXPERIMENTING WITH PARAMETER VALUES FACTOR=0.0625,MULTIPLIER =1, you find zones where price and time reach equilibrium.
The 45 degree line is separator between bullish and bearish zones.
 
Last edited:
#39
HI Mrjlmalhotra
I like your concept as i am developing something on this but using heiken and Gann square nine afl for my Thailand market it looks goodbut need to fix some bugs once done will share my afl as it is auto buying selling for my startegy but i like yours too
can you juse make orange line as supprt ressistance and add buy sell arrow below the line thanks
 
Last edited: