Live World Indices are Powered by Investing.com - The Leading Financial Portal.
Welcome to www.blueeyeforum.com - India's online discussion forum for Stocks, Commodities and Forex.You are currently viewing our board as a guest, which gives you limited access to view most discussions and other features. By joining our free community you will have access to read all posts, reply to different topics, communicate privately with other members(PM), respond to polls, subscribe topics, upload content and access many other special features. Also as a guest you do not have full access to all the forums and specially, the interactive chat room. Registration is fast, simple and absolutely free. Join today and start sharing your views...Get yourself registered here! ;

Amibroker

Members can post and discuss general topics related to share market in this section. Market related views, News related to Market, Companies and Policy Matters may be discussed here.

Moderators: SOMU, Blueeye Moderator


Amibroker

Postby vpukken » Tue Dec 13, 2011 9:40 am

This thread is dedicated to Amibroker lovers. Please contribute what ever you can. Thanks.
VOLATILITY ALWAYS EQUALS OPPORTUNITY

For this message the author vpukken has received thanks: 4
manish midha (Wed Dec 14, 2011 12:44 am), mirpurig (Wed Jan 25, 2012 1:31 pm), NIHAA (Tue Dec 13, 2011 10:56 pm), SOMU (Sat Dec 17, 2011 8:42 pm)
Rating: 11%
 
User avatar
vpukken
MODERATOR
MODERATOR
 
Posts: 3737
Cash on hand: 5,786.00
Bank: 0.00
Joined: Sat May 21, 2011 9:27 am
Has thanked: 1347 times
Have thanks: 1585 times
Blog: View Blog (1)
Karma: 25

Re: Amibroker

Postby rajeshshevade » Tue Jan 03, 2012 12:40 am

Thnaks Manish. I have started playing with trial version of Ami broker and I am sure I will b able to pick up few things sooner rather than later. I am sure u, paul nilopra will always b there to help out. thankx always
rajeshshevade
BLUEEYE MENTOR
BLUEEYE MENTOR
 
Posts: 144
Cash on hand: 153.00
Bank: 0.00
Joined: Thu Nov 24, 2011 9:24 pm
Has thanked: 114 times
Have thanks: 104 times
Blog: View Blog (0)
Real Name: Rajesh Shevade
Gender: Male
Karma: 0

Re: Amibroker

Postby SOMU » Tue Jan 03, 2012 12:52 am

manish midha wrote:ladyblue please contact support@nilopra.com, or support@vpukken.com :)


Very bad support i send 10 email no response :wall: :lol: :lol: :lol:
Image
User avatar
SOMU
GLOBAL MODERATOR
GLOBAL MODERATOR
 
Posts: 17850
Images: 0
Cash on hand: 11,945.00
Bank: 25,887.00
Joined: Fri Apr 22, 2011 11:21 am
Location: Assam
Has thanked: 4360 times
Have thanks: 6606 times
Blog: View Blog (2)
Gender: Male
Karma: 124

Re: Amibroker

Postby manish midha » Tue Jan 03, 2012 7:53 pm

:dance: :dance:
EARNING MONEY NEVER MAKES ME HAPPY, BUT SPENDING IT DOES!
User avatar
manish midha
VIP MEMBER
VIP MEMBER
 
Posts: 945
Cash on hand: 738.00
Joined: Mon May 23, 2011 12:43 pm
Has thanked: 836 times
Have thanks: 480 times
Blog: View Blog (0)
Karma: 15

Re: Amibroker

Postby vpukken » Tue Jan 03, 2012 8:04 pm

Somu's right. Since I dont use amibroker, I dont have any clue. I was just sharing what I found on the net. So we should lock this thread. until we find some expert. :mrgreen: Actually this thread meant for someone experienced in AB.

So all of you come back to MT4. BFD working now :lol:
VOLATILITY ALWAYS EQUALS OPPORTUNITY
User avatar
vpukken
MODERATOR
MODERATOR
 
Posts: 3737
Cash on hand: 5,786.00
Bank: 0.00
Joined: Sat May 21, 2011 9:27 am
Has thanked: 1347 times
Have thanks: 1585 times
Blog: View Blog (1)
Karma: 25

Re: Amibroker

Postby SOMU » Tue Jan 03, 2012 8:41 pm

I think tread should not be closed. I posted that as joke some entertainment into the tread. As all knows such email does not exit. Also contribution towards this tread from nilopra , vphukan and manish is remarkable.

I know 2 of our members using amibroker.I will ask them also to join in this tread. One i haven't meet for sometime in yahoo. Other you all know RADHIKA. I will ask her to participate in this tread.
Image
User avatar
SOMU
GLOBAL MODERATOR
GLOBAL MODERATOR
 
Posts: 17850
Images: 0
Cash on hand: 11,945.00
Bank: 25,887.00
Joined: Fri Apr 22, 2011 11:21 am
Location: Assam
Has thanked: 4360 times
Have thanks: 6606 times
Blog: View Blog (2)
Gender: Male
Karma: 124

Re: Amibroker

Postby vpukken » Tue Jan 03, 2012 9:48 pm

Thanks Somu. Even I was feeling bad for not able to solve their issues.
VOLATILITY ALWAYS EQUALS OPPORTUNITY
User avatar
vpukken
MODERATOR
MODERATOR
 
Posts: 3737
Cash on hand: 5,786.00
Bank: 0.00
Joined: Sat May 21, 2011 9:27 am
Has thanked: 1347 times
Have thanks: 1585 times
Blog: View Blog (1)
Karma: 25

Re: Amibroker

Postby rajeshshevade » Wed Jan 04, 2012 8:52 am

Paul boss, I hv not being able to connect data feeder to AB something going wrong somewhere. cant see the image in the thread that u speak abt. But yes the trial version and datafeed been installed and has shown that they do work. Can u please shed some light if possible??
Regards,
rajesh
rajeshshevade
BLUEEYE MENTOR
BLUEEYE MENTOR
 
Posts: 144
Cash on hand: 153.00
Bank: 0.00
Joined: Thu Nov 24, 2011 9:24 pm
Has thanked: 114 times
Have thanks: 104 times
Blog: View Blog (0)
Real Name: Rajesh Shevade
Gender: Male
Karma: 0

Re: Amibroker

Postby vpukken » Wed Jan 04, 2012 9:18 am

Image


Image
VOLATILITY ALWAYS EQUALS OPPORTUNITY

For this message the author vpukken has received thanks:
manish midha (Wed Jan 04, 2012 8:18 pm)
Rating: 3%
 
User avatar
vpukken
MODERATOR
MODERATOR
 
Posts: 3737
Cash on hand: 5,786.00
Bank: 0.00
Joined: Sat May 21, 2011 9:27 am
Has thanked: 1347 times
Have thanks: 1585 times
Blog: View Blog (1)
Karma: 25

Re: Amibroker

Postby nilopra » Wed Jan 04, 2012 3:48 pm

click File>Database Settings, above 1st window will come. Base time interval can make 1 minute. Following the window:
Image
A man's way of doing things is the direct result of the way he thinks
about things.

For this message the author nilopra has received thanks:
manish midha (Wed Jan 04, 2012 8:18 pm)
Rating: 3%
 
User avatar
nilopra
MODERATOR
MODERATOR
 
Posts: 2440
Cash on hand: 3,023.00
Bank: 748.00
Joined: Mon May 16, 2011 4:23 pm
Has thanked: 1221 times
Have thanks: 706 times
Blog: View Blog (2)
Real Name: NIL
Gender: Male
Karma: 0

Re: Amibroker

Postby vpukken » Wed Jan 04, 2012 4:23 pm

Thank you nilopra.
VOLATILITY ALWAYS EQUALS OPPORTUNITY
User avatar
vpukken
MODERATOR
MODERATOR
 
Posts: 3737
Cash on hand: 5,786.00
Bank: 0.00
Joined: Sat May 21, 2011 9:27 am
Has thanked: 1347 times
Have thanks: 1585 times
Blog: View Blog (1)
Karma: 25

Re: Amibroker

Postby Shilpa » Thu Jan 05, 2012 1:02 am

GANN METHOD

BEST AND SIMPLE METHOD

Code: Select all
_SECTION_BEGIN("INIT");   

   SetChartOptions(0,chartShowArrows|chartShowDates);
   fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);
   tchoice=Param("Title Selection ",2,1,2,1);
   ZigLevel = Param("ZigLevel", 2, 1, 25 );
   numbars = LastValue(Cum(Status("barvisible")));
   dec = (Param("Decimals",2,0,7,1)/10)+1;
   bi = BarIndex();
   Lbi = LastValue(BarIndex());
   sbi = SelectedValue(bi);   
   hts  = Param ("Text Shift", -33.5,-50,50,0.10);

_SECTION_END();

For this message the author Shilpa has received thanks: 2
SOMU (Thu Jan 05, 2012 1:23 am), vpukken (Thu Jan 05, 2012 9:53 am)
Rating: 5%
 
Shilpa
EXEXCUTIVE MEMBER
EXEXCUTIVE MEMBER
 
Posts: 333
Cash on hand: 516.00
Joined: Fri May 27, 2011 9:55 am
Has thanked: 28 times
Have thanks: 103 times
Blog: View Blog (0)
Karma: 0

Re: Amibroker

Postby manish midha » Sat Jan 07, 2012 9:04 pm

Code: Select all
_SECTION_BEGIN("Name");
GfxSetOverlayMode(1);
GfxSelectFont("Tahoma", Status("pxheight")/8 );
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ColorHSB( 42, 42, 42 ) );
GfxSetBkMode(0); // transparent
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/12 );
GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxTextOut( IndustryID(1), Status("pxwidth")/2, Status("pxheight")/4 );

GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxSelectFont("Tahoma", Status("pxheight")/36 );
GfxTextOut( "", Status("pxwidth")/2, Status("pxheight")/3 );
_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 ) ) ));
rg=(H-L);
arg=Wilders(rg,30);
wrb=rg>(2.5*arg);
Cloc=C-L;
x=rg/Cloc;
x1=IIf(Cloc=0,arg,x);
dcls=x1>2;
j=MA(C,5);
tls=LinRegSlope(j,5);
utbar=wrb AND dcls AND tls>0 ;
//barcolor = IIf(utbar, colorRed, colorGreen);
//Plot( C, "Close", barcolor,styleBar );
//PlotShapes( shapeUpArrow *(utbar) , colorWhite, 0, H, 10 );
//Filter =utbar;
//AddColumn(utbar,"Trend Change",1,colorGreen,IIf(utbar,colorRed,colorGreen));

_SECTION_END();
_SECTION_BEGIN("Peak");
//Peak-Trough System + Auto ATR + Position sizing+Varible Sensitivity//
// Last Update 16 Oct 05 By Kook//

PctVlt=(ATR(14)/C)*100;//PercentVolatility

PK=IIf(PctVlt<0.5,Peak(Close,0.5,1),
IIf( PctVlt>=0.5 AND PctVlt< 1.0 ,Peak(Close,0.70,1),
IIf( PctVlt>=1.0 AND PctVlt< 1.5 ,Peak(Close,0.90,1),
IIf( PctVlt>=1.5 AND PctVlt< 2.0 ,Peak(Close,1.10,1),
IIf( PctVlt>=2.0 AND PctVlt< 2.5 ,Peak(Close,1.30,1),
IIf( PctVlt>=2.5 AND PctVlt< 3.0 ,Peak(Close,1.50,1),
IIf( PctVlt>=3.0 AND PctVlt< 3.5 ,Peak(Close,1.70,1),
IIf( PctVlt>=3.5 AND PctVlt< 4.0 ,Peak(Close,2.00,1),
Peak(Close,2.20,1) ))))))));

TGH=IIf(PctVlt<0.5,Trough(Close,0.5,1),
IIf( PctVlt>=0.5 AND PctVlt< 1.0 ,Trough(Close,0.75,1),
IIf( PctVlt>=1.0 AND PctVlt< 1.5 ,Trough(Close,1.00,1),
IIf( PctVlt>=1.5 AND PctVlt< 2.0 ,Trough(Close,1.25,1),
IIf( PctVlt>=2.0 AND PctVlt< 2.5 ,Trough(Close,1.50,1),
IIf( PctVlt>=2.5 AND PctVlt< 3.0 ,Trough(Close,1.75,1),
IIf( PctVlt>=3.0 AND PctVlt< 3.5 ,Trough(Close,2.00,1),
IIf( PctVlt>=3.5 AND PctVlt< 4.0 ,Trough(Close,2.25,1),
Trough(Close,2.50,1) ))))))));

Sens=IIf(PctVlt<0.5,0.5,
IIf( PctVlt>=0.5 AND PctVlt< 1.0 ,0.75,
IIf( PctVlt>=1.0 AND PctVlt< 1.5 ,1.00,
IIf( PctVlt>=1.5 AND PctVlt< 2.0 ,1.25,
IIf( PctVlt>=2.0 AND PctVlt< 2.5 ,1.50,
IIf( PctVlt>=2.5 AND PctVlt< 3.0 ,1.75,
IIf( PctVlt>=3.0 AND PctVlt< 3.5 ,2.00,
IIf( PctVlt>=3.5 AND PctVlt< 4.0 ,2.25,
2.50 ))))))));

Color=IIf(BarsSince(Cross(C,Ref(PK,-1)))<BarsSince(Cross(Ref(TGH,-1),C)),colorBrightGreen,colorRed);

Plot(C,"",Color,styleCandle);
//PlotShapes( Cross(C,Ref(PK,-1))*shapeUpArrow,colorYellow,0,L);
//PlotShapes( Cross(Ref(TGH,-1),C)*shapeDownArrow,colorPink,0,H);
PlotShapes( Cross(84,RSI(36))*shapeDownArrow,colorYellow,0,H,Offset=-28 );
//PlotShapes( Cross(67.4,RSI(171))*shapeDownArrow,colorYellow,0,H,Offset=-28 );
PlotShapes( Cross(27,RSI(95))*shapeUpArrow,colorYellow,0,L,Offset=-28 );

//PlotShapes(  Cross(95.9,StochD(4200))*shapeDownArrow,colorCustom12,0,H,Offset=-28 );
//PlotShapes(  Cross(0.50,StochD(4200))*shapeUpArrow,colorCustom12,0,H,Offset=-28 );


Pivot   =   ParamToggle("Pivot_day", "No|Yes", 1);

if(Pivot)
{
H1= TimeFrameGetPrice("H", inDaily, -1);      // yesterdays high
L1 = TimeFrameGetPrice("L", inDaily, -1);      //            low
C1= TimeFrameGetPrice("C", inDaily, -1);      //            close
Op = TimeFrameGetPrice("O", inDaily)-1;         // current day open

}
else
{
H1 = TimeFrameGetPrice("H", inDaily);      // yesterdays high
L1 = TimeFrameGetPrice("L", inDaily);      //            low
C1= TimeFrameGetPrice("C", inDaily);
Op = TimeFrameGetPrice("O", inDaily);         // current day open

}




// PIVOT Calculation
PP = (H1+ L1 +L1 + C1 )/4;


 
Plot(PP, "PP",colorWhite,4+8+2048 );
Plot( (H1),"HH",colorBrown,4+8+2048);
Plot( (L1),"LL",colorAqua,4+8+2048);

R  = (H1- L1);


R1 = PP + (R * 0.118);
R2 = PP + (R * 0.354);
R3 = PP + (R * 0.59);
R4 = PP + (R * 0.826);
R5 = PP + (R * 1.062);
R6 = PP + (R * 1.298);
R7 = PP + (R * 1.534);
R8 = PP + (R * 1.77);
R9 = PP + (R * 2.006);
R10 = PP + (R * 2.242);
R11 = PP +(R * 2.478);
R12 = PP +(R * 2.714);
R13 = PP +(R * 2.950);
R14 = PP +(R * 3.186);
R15 = PP +(R * 3.422);
R16 = PP +(R * 3.658);
R17 = PP +(R * 3.894);
R18 = PP +(R * 4.130);
R19 = PP +(R * 4.366);



S1 = PP - (R * 0.118);
S2 = PP - (R * 0.354);
S3 = PP - (R * 0.59);
S4 = PP - (R * 0.826);
S5 = PP - (R * 1.062);
S6 = PP - (R * 1.298);
S7 = PP - (R * 1.534);
S8 = PP - (R * 1.77);
S9 = PP - (R * 2.006);
S10 = PP - (R * 2.242);
S11 = PP -(R * 2.478);
S12 = PP -(R * 2.714);
S13 = PP -(R * 2.950);
S14 = PP -(R * 3.186);
S15 = PP -(R * 3.422);
S16 = PP -(R * 3.658);
S17 = PP -(R * 3.894);
S18 = PP -(R * 4.130);
S19 = PP -(R * 4.366);


base =(R2+S2)/2;















// woodies pivots
if ( False )
{
PP = ORBHigh- orblow;   
R1  =  (2 * PP) - DayL;
S1  =  (2 * PP) - DayH;
R2  =  PP + (DayH - DayL);
S2  =  PP - (DayH - DayL);

R3  =  R1 + (DayH - DayL);
S3  =  R2 - (DayH - DayL);

R4  =  R2 + (DayH - DayL);
S4  =  R3 - (DayH - DayL);



}

// regular pivots
if ( False )
{
PP = (DayL + DayH + DayC)/3 ;
R1  =  (2 * PP) - DayL;
S1  =  (2 * PP)  - DayH;
R2  =  (PP - S1) + R1;
S2  =  PP - (R1 - S1);
}
Plot(PP, "PP",colorBlack,4+8+2048);
Plot(R1, "R1",colorBrown,styleDashed+styleNoRescale);
Plot(S1, "S1",colorAqua,styleDashed+styleNoRescale);
Plot(R2, "R2",colorCustom12,styleDashed+styleNoRescale);
Plot(S2, "S2",colorRed,styleDashed+styleNoRescale);
Plot(R3, "R3",colorBlue,styleDashed+styleNoRescale);
Plot(S3, "S3",colorBlue,styleDashed+styleNoRescale);
Plot(R4, "R4",colorCustom4,styleDashed+styleNoRescale);
Plot(S4, "S4",colorCustom4,styleDashed+styleNoRescale);
Plot(R5, "R5",colorCustom1,styleDashed+styleNoRescale);
Plot(S5, "S5",colorCustom1,styleDashed+styleNoRescale);
Plot(R6, "R6",colorBlue,styleDashed+styleNoRescale);
Plot(S6, "S6",colorBlue,styleDashed+styleNoRescale);
Plot(R7, "R7",colorViolet,styleDashed+styleNoRescale);
Plot(S7, "S7",colorViolet,styleDashed+styleNoRescale);
Plot(R8, "R8",colorCustom16,styleDashed+styleNoRescale);
Plot(S8, "S8",colorCustom16,styleDashed+styleNoRescale);
Plot(R9, "R8",colorTan,styleDashed+styleNoRescale);
Plot(S9, "S8",colorTan,styleDashed+styleNoRescale);

Plot(R10, "R10",colorRed,styleDashed+styleNoRescale);
Plot(S10, "S10",colorDarkBlue,styleDashed+styleNoRescale);
Plot(R11, "R11",colorViolet,styleDashed+styleNoRescale);
Plot(S11, "S11",colorViolet,styleDashed+styleNoRescale);
Plot(R12, "R12",colorViolet,styleDashed+styleNoRescale);
Plot(S12, "S12",colorViolet,styleDashed+styleNoRescale);
Plot(R13, "R13",colorViolet,styleDashed+styleNoRescale);
Plot(S13, "S13",colorViolet,styleDashed+styleNoRescale);
Plot(R14, "R14",colorViolet,styleDashed+styleNoRescale);
Plot(S14, "S14",colorViolet,styleDashed+styleNoRescale);
Plot(R15, "R15",colorViolet,styleDashed+styleNoRescale);
Plot(S15, "S1",colorViolet,styleDashed+styleNoRescale);
Plot(R16, "R16",colorViolet,styleDashed+styleNoRescale);
Plot(S16, "S16",colorViolet,styleDashed+styleNoRescale);

Plot(R17, "R17",colorViolet,styleDashed+styleNoRescale);
Plot(S17, "S17",colorViolet,styleDashed+styleNoRescale);
Plot(R18, "R18",colorViolet,styleDashed+styleNoRescale);
Plot(S18, "S18",colorViolet,styleDashed+styleNoRescale);
Plot(R19, "R19",colorViolet,styleDashed+styleNoRescale);
Plot(S19, "S19",colorViolet,styleDashed+styleNoRescale);


_SECTION_END();
Plot(EMA(C,20), "EMA21", colorBlue , styleLine|styleThick  );
Plot(EMA(C,10), "EMA13",colorYellow , styleLine|styleThick );
Plot(Wilders(H,260.6), "WILDERS",colorCustom12 ,styleDashed|styleNoRescale);

_SECTION_BEGIN("RSI BUY SELL");
n=45;
per =9;
x = Cum(1);
s1=IIf(RSIa(L,n)>Min(RSIa(C,n),RSIa(O,n)),Min(RSIa(C,n),RSIa(O,n)),RSIa(L,n));
s11=IIf(RSIa(H,n)<Max(RSIa(C,n),RSIa(O,n)),Max(RSIa(C,n),RSIa(O,n)),RSIa(H,n));
pS = TroughBars( s1, per, 1 ) == 0;
endt= LastValue(ValueWhen( pS, x, 1 ));
startt=LastValue(ValueWhen( pS, x, 2 ));
dtS =endt-startt;
endS = LastValue(ValueWhen( pS, s1, 1 ) );
startS = LastValue( ValueWhen( pS, s1, 2  ));
aS = (endS-startS)/dtS;bS = endS;
trendlineS = aS * ( x  -endt ) + bS;
pR = PeakBars( s11, per, 1 ) == 0;
endt1= LastValue(ValueWhen( pR, x, 1 ));
startt1=LastValue(ValueWhen( pR, x, 2 ));
dtR =endt1-startt1;
endR = LastValue(ValueWhen( pR, s11, 1 ) );
startR = LastValue( ValueWhen( pR, s11, 2  ));
aR = (endR-startR)/dtR;
bR = endR;
trendlineR = aR * ( x  -endt1 ) + bR;
//Plot(ValueWhen( (S1==trendlineS ), L),"", colorGreen, styleDashed|styleNoRescale|styleThick);
//Plot(ValueWhen((S11==trendlineR ), H),"", colorRed, styleDashed|styleNoRescale|styleThick);
Buy =  (S1==trendlineS );
Sell =  (S11==trendlineR );
Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorRed, colorCustom12) );
dist = 0.9*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Buy[i] ) PlotText( "Rsi45 Buy " + L[ i ], i, L[ i ]-dist[i], colorWhite);
if( Sell[i] ) PlotText( "Rsi45 Sell " + H[ i ], i, H[ i ]+dist[i], colorCustom12);
}







_SECTION_END();



////////////////////////////////////////////EXPLORATION

Filter= (Buy OR Sell);
AddColumn(Buy,"BUY CALL",1,-1);
AddColumn( Sell, "SELL CALL", 1,-1 );




///////////////////////EXPLORATION ENDS









//Topping Bar
//Range = H - L ;
//TPB = Volume > MA(Volume,9) AND Close < Low + Range/2 AND Range <= Ref(Range,-1);
//PlotShapes(shapeSmallCircle * TPB,colorYellow,0,H,20);

_SECTION_BEGIN("Advanced Trend Lines");
function GetXSupport(Lo, Percentage, Back)
{
 return ((BarCount - 1) - LastValue(TroughBars(Lo, Percentage,Back)));
}
function GetYSupport(Lo, Percentage, Back)
{
 return (LastValue(Trough(Lo, Percentage, back)));
}

function GetXResistance(Hi, Percentage, Back)
{
 return ((BarCount - 1) -LastValue(PeakBars(Hi, Percentage, Back)));
}
function GetYResistance(Hi, Percentage, Back)
{
 return (LastValue(Peak(Hi, Percentage, Back)));
}
function TD_Supply(P)
{
   return ( P > Ref(P, 1) AND P > Ref(P, -1) AND P > Ref(C, -2));
}
function TD_Demand(P)
{
   return ( P < Ref(P, 1) AND P < Ref(P, -1) AND P < Ref(C, -2));
}
////////////////////////////////////////////////////////////////////////
//Parameters
Percentage    = Param("Percentage", 5.55, 0.01, 100. ,0.01);
DrawAllLines    = ParamToggle("Draw All Lines?", "No|Yes", 1);
Lines          = Param("Lines?", 3, 1, BarCount-2);
DrawR          = ParamList("Resistance Points", "Off|High to High|High to Low", 1);
DrawS          = ParamList("Support Points", "Off|Low to Low|Low to High", 1);
ShowTDP       = ParamToggle("Show TD Pionts", "No|Yes", 0);
AllOrDownR    = ParamToggle("Resistance Direction", "All|Down");
AllOrUpS       = ParamToggle("Support Direction", "All|Up");
ShowSR         = ParamToggle("Show Vert S/R","No|Yes", 1);
SRPer         = Param("S/R Percentage", 1.618, 1);
SRBack         = Param("S/R Back", 1, 1);
str = "";
Res = Sup = 0;
Con = 1;
////////////////////////////////////////////////////////////////////////
Main = C;
Con = ConS = ConR = 1;
if(DrawS=="Low to Low")
{
   Support1 = L;
   Support2 = L;
}
else
{
   Support1 = L;
   Support2 = H;
}
if(DrawR=="High to High")
{
   Resistance1 = H;
   Resistance2 = H;
}
else
{
   Resistance1 = H;
   Resistance2 = L;
}
////////////////////////////////////////////////////////////////////////
//Plotting Area
Plot(Main, "", IIf(C>O,colorGreen, colorRed), styleBar);
if(DrawAllLines)
for(i = 2; i<=Lines+1; i++)
{
   if(DrawS!="Off")
   {
      x0 = GetXSupport(Support1, Percentage, i);
      x1 = GetXSupport(Support2, Percentage, i-1);
      y0 = GetYSupport(Support1, Percentage, i);
      y1 = GetYSupport(Support2, Percentage, i-1);
      x = LineArray(x0, y0, x1, y1, 1);
      if(AllOrUpS) ConS = StrToNum(NumToStr(y0 < y1));
      if(Con AND ConS)
         Plot(x, "", IIf(LastValue(C) < LastValue(x), colorBlue,colorYellow),4+8+2048);

   }
   if(DrawR!="Off")
   {
      x0 = GetXResistance(Resistance1, Percentage, i);
      x1 = GetXResistance(Resistance2, Percentage, i-1);
      y0 = GetYResistance(Resistance1, Percentage, i);
      y1 = GetYResistance(Resistance2, Percentage, i-1);
      x = LineArray(x0, y0, x1, y1, 1);
      if(AllOrDownR) ConR = y0 > y1;
      if(Con AND ConR)
         Plot(x, "",  IIf(LastValue(C) < LastValue(x), colorBlue,colorYellow),4+8+2048);

   }
}
else
{
   if(DrawS!="Off")
   {
      x0 = GetXSupport(Support1, Percentage, Lines+1);
      x1 = GetXSupport(Support2, Percentage, Lines);
      y0 = GetYSupport(Support1, Percentage, Lines+1);
      y1 = GetYSupport(Support2, Percentage, Lines);
      x = LineArray(x0, y0, x1, y1, 1 );
      Sup = LastValue(LinRegSlope(x, Lines+1));
      if(AllOrUpS) ConS = y0 < y1;
      if(Con AND ConS)
         Plot(x, "", IIf(LastValue(C) < LastValue(x), colorBlue,colorYellow),4+8+2048);

   }
   if(DrawR!="Off")
   {
      x0 = GetXResistance(Resistance1, Percentage, Lines+1);
      x1 = GetXResistance(Resistance2, Percentage, Lines);
      y0 = GetYResistance(Resistance1, Percentage, Lines+1);
      y1 = GetYResistance(Resistance2, Percentage, Lines);
      x = LineArray(x0, y0, x1, y1, 1 );
      Res = LastValue(LinRegSlope(x, Lines+1));
      if(AllOrDownR) ConR = y0 > y1;
      if(Con AND ConR)
         Plot(x, "",  IIf(LastValue(C) < LastValue(x), colorBlue,colorYellow),4+8+2048);

   }
str = "\nR Slope=("+Res+"), S Slope=("+Sup+")";
}

if(ShowTDP)
{
   PlotShapes(TD_Supply(H)*shapeSmallCircle, colorRed, 0, H, H*.001);
   PlotShapes(TD_Demand(L)*shapeSmallCircle, colorGreen, 0, L, -L*.001);
}
if(ShowSR)
{
   for(i=1; i<=SRBack; i++)
   {
      x0 = GetXSupport(L, SRPer, i);
      x1 = BarCount-1;
      y0 = GetYSupport(L, SRPer, i);
      x = LineArray(x0, y0, x1, y0, 0);
      //Plot(x, "", IIf(LastValue(C) > x, colorCustom13, colorCustom12), 4+8+2048);

      x0 = GetXResistance(H, SRPer, i);
      y0 = GetYResistance(H, SRPer, i);
      x = LineArray(x0, y0, x1, y0, 0);
      //Plot(x, "", IIf(LastValue(C) > x, colorCustom13, colorCustom12), 4+8+2048);


   }
}
Title =FullName()+" ({{NAME}})\n{{DATE}}\n"+"Open: "+O+", Hi: "+H+", Lo: "+L+", Close: "+C+StrFormat(" (%.2f  %.2f\%)", C-Ref(C, -1), SelectedValue(ROC(C, 1)))+str;




_SECTION_END();

_SECTION_BEGIN("Background");
   SetChartOptions(0,chartShowArrows|chartShowDates);
   SetChartBkColor(ParamColor("Outer panel",colorBlack)); // color of outer border
   SetChartBkGradientFill( ParamColor("Inner panel upper",colorBlack),ParamColor("Inner panel lower",colorBlack));
   tchoice=Param("Title Selection ",2,1,2,1);

//Plot(C, "", IIf(O>=C, colorOrange, colorGreen), ParamStyle("Price Style",styleBar,maskPrice));
//////////////////////////////////////////////////////////////////
_SECTION_BEGIN("Fib Retracements");
   fibs = ParamToggle("Plot Fibs","Off|On",1);
   pctH = Param ("Pivot Hi %", 1.618,0.001,2.0,0.002);
   HiLB = Param ("Hi LookBack",1,1,BarCount-1,1);
   pctL = Param ("Pivot Lo %", 1.618,0.001,2.0,0.002);
   LoLB = Param ("Lo LookBack",1,1,BarCount-1,1);
   Back = Param ("Extend Left = 2",1,1,500,1);
   Fwd  = Param("Plot Forward", 0, 0, 500, 1);
   text = ParamToggle("Plot Text","Off|On",1);
   hts  = Param ("Text Shift", -33.5,-50,50,0.10);
   style =ParamStyle("Line Style",styleLine,styleNoLabel);
x = BarIndex();
pRp  = PeakBars( H, pctH, 1) == 0;
yRp0 = SelectedValue(ValueWhen( pRp, H, HiLB));
xRp0 = SelectedValue(ValueWhen( pRp, x, HiLB));
pSp  = TroughBars( L, pctL, 1) == 0;
ySp0 = SelectedValue(ValueWhen( pSp, L, LoLB));
xSp0 = SelectedValue(ValueWhen( pSp, x, LoLB));
Delta = yRp0 - ySp0;

function fib(ret)
{
retval = (Delta * ret);
Fibval = IIf(ret < 1.0
AND xSp0 < xRp0, yRp0 - retval, IIf(ret < 1.0
AND xSp0 > xRp0, ySp0 + retval,IIf(ret > 1.0
AND xSp0 < xRp0, yRp0 - retval, IIf(ret > 1.0
AND xSp0 > xRp0, ySp0 + retval, Null))));
return FibVal;
}

x0 = Min(xSp0,xRp0)-Back;
x1 = (BarCount -1);
//////////////////////////////////////////////////////////////////
r236 = fib(0.236);   r236I = LastValue (r236,1);
r382 = fib(0.382);   r382I = LastValue (r382,1);
r050 = fib(0.50);      r050I = LastValue (r050,1);
r618 = fib(0.618);   r618I = LastValue (r618,1);
r786 = fib(0.786);   r786I = LastValue (r786,1);
e127 = fib(1.27);      e127I = LastValue (e127,1);
e162 = fib(1.62);      e162I = LastValue (e162,1);
e200 = fib(2.00);      e200I = LastValue (e200,1);
e262 = fib(2.62);      e262I = LastValue (e262,1);
e424 = fib(4.24);      e424I = LastValue (e424,1);
//////////////////////////////////////////////////////////////////
p00 = IIf(xSp0 > xRp0,ySp0,yRp0);    p00I = LastValue (p00,1);
p100 = IIf(xSp0 < xRp0,ySp0,yRp0);    p100I = LastValue (p100,1);
color00 =IIf(xSp0 > xRp0,colorLime,colorRed);
color100 =IIf(xSp0 < xRp0,colorLime,colorRed);
//////////////////////////////////////////////////////////////////
numbars = LastValue(Cum(Status("barvisible")));
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);
//////////////////////////////////////////////////////////////////
if(fibs==1)
{
//Plot(LineArray(xRp0-Fwd,yRp0,x1,yRp0,Back),"PR",32,8|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(xSp0-Fwd,ySp0,x1,ySp0,Back),"PS",27,8|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,r236,x1,r236,Back),"",45,style|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,r382,x1,r382,Back),"",44,style|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,r050,x1,r050,Back),"",41,style|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,r618,x1,r618,Back),"",43,style|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,r786,x1,r786,Back),"",42,style|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,e127,x1,e127,Back),"e127",47,style|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,e162,x1,e162,Back),"e162",47,style|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,e200,x1,e200,Back),"p200",47,style|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,e262,x1,e262,Back),"p262",47,style|styleNoRescale,Null, Null,Fwd);
//Plot(LineArray(x0-Fwd,e424,x1,e424,Back),"p424",25,style|styleNoRescale,Null, Null,Fwd);
}
//////////////////////////////////////////////////////////////////
if(text==1)
{
PlotText(" 0% = " + WriteVal(p00,fraction),    LastValue(BarIndex())-(numbars/hts), p00I  + 0.05, color00);
PlotText("23% = " + WriteVal(r236,fraction), LastValue(BarIndex())-(numbars/hts), r236I + 0.05, 45);
PlotText("38% = " + WriteVal(r382,fraction), LastValue(BarIndex())-(numbars/hts), r382I + 0.05, 44);
PlotText("50% = " + WriteVal(r050,fraction), LastValue(BarIndex())-(numbars/hts), r050I + 0.05, 41);
PlotText("62% = " + WriteVal(r618,fraction), LastValue(BarIndex())-(numbars/hts), r618I + 0.05, 43);
PlotText("78% = " + WriteVal(r786,fraction), LastValue(BarIndex())-(numbars/hts), r786I + 0.05, 42);
PlotText("100% = " + WriteVal(p100,fraction), LastValue(BarIndex())-(numbars/hts),p100I + 0.05, color100);
PlotText("127% = " + WriteVal(e127,fraction), LastValue(BarIndex())-(numbars/hts),e127I + 0.05, 47);
PlotText("162% = " + WriteVal(e162,fraction), LastValue(BarIndex())-(numbars/hts),e162I + 0.05, 47);
PlotText("200% = " + WriteVal(e200,fraction), LastValue(BarIndex())-(numbars/hts),e200I + 0.05, 47);
PlotText("262% = " + WriteVal(e262,fraction), LastValue(BarIndex())-(numbars/hts),e262I + 0.05, 47);
PlotText("424% = " + WriteVal(e424,fraction), LastValue(BarIndex())-(numbars/hts),e424I + 0.05, 25);
}
_SECTION_END();
//////////////////////////////////////////////////////////////////
if (tchoice==1 )
{
_N(Title = EncodeColor(colorWhite)+StrFormat(" {{NAME}} -   {{INTERVAL}}      {{DATE}}    Open:  %g,    High:  %g,     Low:  %g,     Close:  %g     {{VALUES}}",O, H, L, C, SelectedValue( ROC( C, 1   ) ) ));
}
//////////////////////////////////////////////////////////////////
if (tchoice==2 )
{
Title = EncodeColor(colorWhite)+  Date() + "   Tick = " + EncodeColor(5) + Interval()+
EncodeColor(colorWhite) + "     Open = " + EncodeColor(colorWhite) + O +
EncodeColor(colorWhite) + "     High = " + EncodeColor(5) + H +
EncodeColor(colorWhite) + "      Low = " + EncodeColor(colorRed) + L +
EncodeColor(colorWhite) + "     Close = " + EncodeColor(colorWhite) + C + "\n" +
EncodeColor( colorWhite) +"_______________"+"\n"+
EncodeColor( colorWhite)  + "424%   =  "   +    EncodeColor(25)+ e424 + " " +"\n"+
EncodeColor( colorWhite)  + "262%   =  "   +    EncodeColor(47)+ e262 + " " +"\n"+
EncodeColor( colorWhite)  + "200%   =  "   +    EncodeColor(47)+ e200 + " " +"\n"+
EncodeColor( colorWhite)  + "162%   =  "   +    EncodeColor(47)+ e162 + " " +"\n"+
EncodeColor( colorWhite)  + "127%   =  "   +    EncodeColor(47)+ e127 + " " +"\n"+
EncodeColor( colorYellow) + "  Res    =  "   +    EncodeColor(32)+ p100 + " " +"\n"+
EncodeColor( colorWhite)  + "  78%   =  "   +   EncodeColor(42)+ r786 + " " +"\n"+
EncodeColor( colorWhite)  + "  62%   =  "   +    EncodeColor(43)+ r618 + " " +"\n"+
EncodeColor( colorWhite)  + "  50%   =  "   +    EncodeColor(41)+ r050 + " " +"\n"+
EncodeColor( colorWhite)  + "  38%   =  "   +    EncodeColor(44)+ r382 + " " +"\n"+
EncodeColor( colorWhite)  + "  23%   =  "   +    EncodeColor(45)+ r236+ " " +"\n"+
EncodeColor( colorYellow) + "  Sup   =   "   +    EncodeColor(34)+ p00 + " " ;
}
GraphXSpace=5;


////////////////////////////////////////////////////volume with divider for the day in intra day

_SECTION_BEGIN("MPLite Kaka");
//PlotOHLC(O,H,L,C,"Price",IIf(C>O,colorGreen,colorRed),styleCandle);

function Lastthursday()
{
 Daysinmonth=IIf(Month()==1 OR Month()==3 OR Month()==5 OR Month()==7 OR Month()==8 OR Month()==10 OR Month()==12,31,30);
 Daysinmonthfeb=IIf(Year()%4 == 0 AND Year()%100!=0,29,28);
 Daysinmonthfinal=IIf(Month()==2,Daysinmonthfeb,Daysinmonth);
 returnvalue=IIf(Daysinmonthfinal-Day()<7 AND DayOfWeek()==4,1,IIf(Daysinmonthfinal-Day()<8 AND DayOfWeek()==3 AND Ref(DayOfWeek(),1)!=4,1,0));
 return returnvalue;
}

FirstVisibleBar = Status( "FirstVisibleBar" );
Lastvisiblebar = Status( "LastVisibleBar" );

totalVisible=Lastvisiblebar-FirstVisibleBar;
//if(totalVisible<1500){

//Den = Param("Density", 1, 0.1, 10, 0.1);
percent=Param("Value Area", 70, 1, 100, 1);
Type=ParamList("Type","Price Profile|Volume Profile");
Period= ParamList("Base","Hourly|Daily|Weekly|Monthly|Lastthursday|Yearly",1);
x_scale=Param("Horizontal_scale", 2, 0, 10, 0.1);
EnMP2= ParamStyle("Style",styleLine|styleNoLabel,maskAll);
styleLines=styleDots;
ViewYvalues= ParamToggle("Show Yesterdays Values", "No|Yes",1);
ViewVlines= ParamToggle("Show Vertical Base Lines", "No|Yes",1);
Viewvalues= ParamToggle("Show Values", "No|Yes",0);
ViewVpoc= ParamToggle("Show Virgin POC", "No|Yes",1);
ViewTPO=ParamToggle("Show TPO Count", "No|Yes",0);

if(Period=="Hourly"){
BarsInDay = BarsSince(Hour() != Ref(Hour(), -1));Bot = TimeFrameGetPrice("L", inHourly, 0);Top = TimeFrameGetPrice("H", inHourly, 0);Vol = TimeFrameGetPrice("V", inHourly, 0);
}
if(Period=="Daily" ){//OR Interval()==3600
BarsInDay = BarsSince(Day() != Ref(Day(), -1));Bot = TimeFrameGetPrice("L", inDaily, 0);Top = TimeFrameGetPrice("H", inDaily, 0);Vol = TimeFrameGetPrice("V", inDaily, 0);
}
if(Period=="Weekly" OR Interval()==24 * 3600 ){
BarsInDay = BarsSince(DayOfWeek() < Ref( DayOfWeek(), -1 ));Bot = ValueWhen(Ref(BarsInDay,1)==1 OR BarIndex()>BarCount-2 ,LLV(L,BarsInDay),0);Top =ValueWhen(Ref(BarsInDay,1)==1 OR BarIndex()>BarCount-2,HHV(H,BarsInDay),0);Vol = TimeFrameGetPrice("V", inWeekly, 0);
}
if(Period=="Monthly"  ){
BarsInDay = BarsSince(Month() != Ref(Month(), -1));Bot = TimeFrameGetPrice("L", inMonthly, 0);Top = TimeFrameGetPrice("H", inMonthly, 0);Vol = TimeFrameGetPrice("V", inMonthly, 0);
}

if(Period=="Lastthursday"  ){
BarsInDay = BarsSince(Lastthursday()==1 AND Ref(Lastthursday(), -1)==0);Bot = ValueWhen(Ref(BarsInDay,1)==1 OR BarIndex()>BarCount-2 ,LLV(L,BarsInDay),0);Top =ValueWhen(Ref(BarsInDay,1)==1 OR BarIndex()>BarCount-2,HHV(H,BarsInDay),0);Vol = TimeFrameGetPrice("V", inMonthly, 0);
}

if(Period=="Yearly"  ){
BarsInDay = BarsSince(Year() != Ref(Year(), -1));Bot = TimeFrameGetPrice("L", inYearly, 0);Top = TimeFrameGetPrice("H", inYearly, 0);Vol = TimeFrameGetPrice("V", inYearly, 0);
}

Range =  Top-Bot;
coverage=LastValue(ATR(10));

den=(coverage/10);

//multiplier=IIf(round(totalVisible)>500,IIf(round(totalVisible)>1000,3,2),1);

HaClose = (O + H + L + C)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
xDiff = (HaHigh - Halow) * 10000;
barcolor = IIf(HaClose >= HaOpen,colorGreen,colorRed);
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "", barcolor, styleCandle );

multiplier=IIf(round(totalVisible)/300<1,1,round(totalVisible)/300);


if(ViewVlines==1)
{
Plot(BarsInDay==0, "", ParamColor("Base Line Color",colorDarkGrey), styleHistogram | styleOwnScale | styleLine | styleNoLabel);
}


relTodayRange = 0;
x=0;
basey=0;
basex=0;
newday=0;
total=0;
shiftup=0;
shiftdn=0;
Line=Null;
Voloumeunit=0;


for (  i = FirstVisibleBar; i <Lastvisiblebar AND i<BarCount-1 ; i++  )
{
   if(BarsInDay[i]==0)
   {t=BarsInDay[i-1];



      //////////////////////////////////
poc=0;pocj=0;
midrange = int(relTodayRange/2)+1;


for (j=1; j<= relTodayRange+1 ; j++)
   {
      if(poc < x[j])
      {
      poc=x[j]; pocj=j;}
      else if(poc == x[j])
         {
         if (abs(midrange-j)< abs(midrange-pocj)){
         poc = x[j]; pocj = j;
         }
      }
 
   }

for ( n = 1; n <= relTodayRange; n++ )
   {
      total[n]=x[n]+total[n-1];
   }

Value_area=(total[relTodayRange]*percent)/100;


for ( a = 1; a <= relTodayRange; a++ )
{
   if(pocj-a>0 AND pocj+a<relTodayRange)
   {
      if(poc+total[pocj+a]-total[pocj]+(total[pocj]-poc)-total[pocj-(a+1)]>=Value_area) {shiftup=a; shiftdn=a; break;}
       }   
      else if(pocj-a<1 )
      {
      if(poc+total[pocj+a]-total[pocj]+(total[pocj]-poc)>=Value_area){shiftup=a; shiftdn=pocj; break;}      
         }
      else if(pocj+a>relTodayRange )
      {
      if(poc+total[relTodayRange]-total[pocj]+(total[pocj]-poc)-total[pocj-(a+1)] >=Value_area){shiftup=floor(relTodayRange)-pocj; shiftdn=a+1; break;}      
      }
}


if(ViewVpoc==1)
{
Virginpoc=basey+pocj*den;
newi=0;
for( j = i+1; j <= (BarCount - 1) ; j++ )
if( L[j] < Virginpoc AND H[j]>Virginpoc )
{newi=j;break;}
else{newi=BarCount;}
vishycolor=IIf(BarCount%2==0,colorRed,colorBlue);
Plot(LineArray(basex[i],basey+pocj*den,newi,basey+pocj*den),"",vishycolor,styleLine|styleNoRescale);
//Plot(LineArray(basex[i],basey+pocj*den,newi,basey+pocj*den),"",colorYellow,styleLine|styleNoRescale);
}

Vah = LineArray(baseX[i], baseY+(pocj+shiftup)*den, i, baseY+(pocj+shiftup)*den);
Val = LineArray(baseX[i], baseY+(pocj-shiftdn)*den, i, baseY+(pocj-shiftdn)*den);
pocline=LineArray(basex,basey+pocj*den,basex[i]+poc,basey+pocj*den);

//Plot(Vah,"",ParamColor("Color_VAH_Line", colorBlueGrey),styleLine|styleNoRescale);
//Plot(Val,"",ParamColor("Color_VAL_Line", colorBlueGrey),styleLine|styleNoRescale);

Vahn = LineArray(i, baseY+(pocj+shiftup)*den, i+t, baseY+(pocj+shiftup)*den);
pocn = LineArray(i, baseY+(pocj)*den, i+t, baseY+(pocj)*den);
Valn = LineArray(i, baseY+(pocj-shiftdn)*den, i+t, baseY+(pocj-shiftdn)*den);

Plot(pocline,"",ParamColor("Color_POC_Line",colorDarkBlue),styleLine|styleNoRescale|styleNoLabel);

if(ViewYvalues==1)
{
Plot(Vahn,"",ParamColor("YVAH",colorBrightGreen),styleDashed|styleNoRescale);
Plot(Valn,"",ParamColor("YVAL",colorYellow),styleDashed|styleNoRescale);
Plot(pocn,"",ParamColor("YPOC",colorDarkRed),styleDashed|styleNoRescale);

}
//PlotOHLC(Vahn,Vahn,Valn,Valn,"",colorPink,styleCloud|styleOwnScale);


if(ViewTPO==1)
{
nnn=HHV(H,BarsInDay);
PlotText(""+(total[relTodayRange]-total[pocj]),basex[i],nnn[i],colorLightGrey);
PlotText(""+(total[pocj-1]),basex[i],basey-den,colorLightGrey);
}

if(Viewvalues==1)
{
PlotText(""+((basey+pocj*den)),baseX[i],basey+pocj*den,colorWhite,colorDarkGrey);
PlotText(""+((baseY+(pocj+shiftup)*den)),baseX[i],baseY+(pocj+shiftup)*den,colorWhite,colorDarkGrey);
PlotText(""+((baseY+(pocj-shiftdn)*den)),baseX[i],baseY+(pocj-shiftdn)*den,colorWhite,colorDarkGrey);
}


for (p = 0; p <= relTodayRange+1; p=p+multiplier)
{
   if(P>0){
   line = LineArray(baseX, baseY+(p)*Den, baseX+x[p], baseY+(p)*Den);

   }
   
   Plot(line,"",IIf(p>(pocj+shiftup),ParamColor("Color_Above_VA",  colorDarkRed),IIf(p<=(pocj+shiftup)AND p>=(pocj-shiftdn),ParamColor("Color_VA", colorDarkBlue),ParamColor("Color_Below_VA",   colorDarkRed))) , EnMP2);

   
}

Plot(pocline,"",ParamColor("Color_POC_Line",colorDarkRed),styleLine|styleNoRescale);

///////////////////

basex=0;
      x=0;
      Basex=i;
      baseY=Bot[i];
      relTodayRange=Range[i]/Den;
      Voloumeunit=Vol[i]/LastValue(BarsInDay);

   }

   for (j=0; j<= relTodayRange ; j++)
   {   
      if (L[i] <= Bot[i]+j*Den AND H[i] >= Bot[i]+j*Den  )
      {
         if(Type=="Price Profile"){x[j]=(x[j])+x_scale;}
         else if(Type=="Volume Profile"){x[j]=x[j]+round(V[i]/Voloumeunit)+1;}
      }
   }
}

   
//////////////////////////////////
poc=0;pocj=0;
midrange = int(relTodayRange/2)+1;

for (j=1; j<= relTodayRange+1 ; j++)
   {
      if(poc < x[j])
      {
      poc=x[j]; pocj=j;}
      else if(poc == x[j])
         {
         if (abs(midrange-j)< abs(midrange-pocj)){
         poc = x[j]; pocj = j;
         }
      }
 
   }

for ( n = 1; n <= relTodayRange; n++ )
   {
      total[n]=x[n]+total[n-1];
   }

Value_area=(total[relTodayRange]*percent)/100;


for ( a = 1; a <= relTodayRange; a++ )
{
   if(pocj-a>0 AND pocj+a<relTodayRange)
   {
      if(poc+total[pocj+a]-total[pocj]+(total[pocj]-poc)-total[pocj-(a+1)]>=Value_area) {shiftup=a; shiftdn=a; break;}
       }   
      else if(pocj-a<1 )
      {
      if(poc+total[pocj+a]-total[pocj]+(total[pocj]-poc)>=Value_area){shiftup=a; shiftdn=pocj; break;}      
         }
      else if(pocj+a>relTodayRange )
      {
      if(poc+total[relTodayRange]-total[pocj]+(total[pocj]-poc)-total[pocj-(a+1)] >=Value_area){shiftup=floor(relTodayRange)-pocj; shiftdn=a+1; break;}      
      }
}

Vah = LineArray(baseX[i], baseY+(pocj+shiftup)*den, i, baseY+(pocj+shiftup)*den);
Val = LineArray(baseX[i], baseY+(pocj-shiftdn)*den, i, baseY+(pocj-shiftdn)*den);
pocline=LineArray(basex,basey+pocj*den,basex[i]+poc,basey+pocj*den);

if(ViewTPO==1)
{
PlotText(""+(total[relTodayRange]-total[pocj]),basex[i],top[i],colorLightGrey);
PlotText(""+(total[pocj-1]+x_scale),basex[i],basey-den,colorLightGrey);
}

if(Viewvalues==1)
{
PlotText(""+((basey+pocj*den)),baseX[i],basey+pocj*den,colorWhite,colorDarkGrey);
PlotText(""+((baseY+(pocj+shiftup)*den)),baseX[i],baseY+(pocj+shiftup)*den,colorWhite,colorDarkGrey);
PlotText(""+((baseY+(pocj-shiftdn)*den)),baseX[i],baseY+(pocj-shiftdn)*den,colorWhite,colorDarkGrey);
}

for (p = 0; p <= relTodayRange+1; p=p+multiplier)
{
   line = LineArray(baseX, baseY+p*Den, baseX+x[p], baseY+p*Den);

   Plot(line,"",IIf(p>(pocj+shiftup),ParamColor("Color_Above_VA",  colorGrey40),IIf(p<=(pocj+shiftup)AND p>=(pocj-shiftdn),ParamColor("Color_VA", colorBlueGrey),ParamColor("Color_Below_VA",colorGrey40))),EnMP2);
   
   Plot(pocline,"",ParamColor("Color_POC_Line",colorYellow),styleLine|styleNoRescale|styleNoLabel);
}
_SECTION_END();

_SECTION_BEGIN("Volume");
Plot( Volume, _DEFAULT_NAME(), ParamColor("Color", colorDarkGreen), styleNoTitle | ParamStyle( "Style", styleHistogram | styleOwnScale | styleThick | styleNoLabel, maskHistogram  ), 2 );
_SECTION_END();
EARNING MONEY NEVER MAKES ME HAPPY, BUT SPENDING IT DOES!
User avatar
manish midha
VIP MEMBER
VIP MEMBER
 
Posts: 945
Cash on hand: 738.00
Joined: Mon May 23, 2011 12:43 pm
Has thanked: 836 times
Have thanks: 480 times
Blog: View Blog (0)
Karma: 15

Re: Amibroker

Postby manish midha » Sat Jan 07, 2012 9:07 pm

radhika ji & nilo sir please check the code posted above, can u change the settings so that buy sell signal can be seen for 5 days chart. now its showing intraday only.

thanks & regards
EARNING MONEY NEVER MAKES ME HAPPY, BUT SPENDING IT DOES!
User avatar
manish midha
VIP MEMBER
VIP MEMBER
 
Posts: 945
Cash on hand: 738.00
Joined: Mon May 23, 2011 12:43 pm
Has thanked: 836 times
Have thanks: 480 times
Blog: View Blog (0)
Karma: 15

Re: Amibroker

Postby LADYBLUE » Sat Jan 07, 2012 9:49 pm

LICENSE ERROR (Please contact support@amibroker.com)

Any solution?

For this message the author LADYBLUE has received thanks:
uvmurthy (Tue Jan 10, 2012 10:09 pm)
Rating: 3%
 
LADYBLUE
BANNED MEMBER
BANNED MEMBER
 
Posts: 275
Cash on hand: 0.00
Joined: Tue Aug 23, 2011 11:19 pm
Has thanked: 135 times
Have thanks: 76 times
Blog: View Blog (0)
Karma: 0

Re: Amibroker

Postby manish midha » Sun Jan 08, 2012 12:07 am

http://amibroker.com/download.html ladyblue try 5.4 version demo from here.
EARNING MONEY NEVER MAKES ME HAPPY, BUT SPENDING IT DOES!
User avatar
manish midha
VIP MEMBER
VIP MEMBER
 
Posts: 945
Cash on hand: 738.00
Joined: Mon May 23, 2011 12:43 pm
Has thanked: 836 times
Have thanks: 480 times
Blog: View Blog (0)
Karma: 15

PreviousNext


  • SHARE TOPIC HERE

Return to MARKET VIEWS AND GENERAL MARKET RELATED DISCUSSION

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Disclaimer: The messages and ideas posted on this website are users' own views. We do not own any responsibility for the information provided by the users. Its for learning purpose. No liability whatsoever lies with Blueeyeforum.com. All rights reserved.