Thank you Panos,

 

Exactly what I was looking for.

 

Tom

 

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Panos Boufardeas
Sent: Monday, September 22, 2008 7:42 PM
To: [email protected]
Subject: Re: [amibroker] Fill method

 

yes you have to use style styleCloud
there are many examples in the help file

_SECTION_BEGIN("Stochastic styleCloud");
SetChartOptions( Mode = 0, Flags = 0, gridFlags = 0) ;
SetChartBkColor(ParamColor("Öüíôï ",colorBlack));
GraphXSpace= 5;

function StochMom(array, periods, smoothpds, smoothpds2)
{
mid = ( HHV(H,periods) + LLV(L,periods) )/2 ;
diff = HHV(H,periods) - LLV(L,periods) ;
alpha = 2 / (smoothpds+1);
alpha2 = 2 / (smoothpds2+1);
X1 = AMA(array-mid, alpha);
X2 = AMA(X1, alpha2);
X3 = AMA(diff,alpha);
X4 = AMA(X3,alpha2)/2;
return Min(1,(X2/X4))*100 ;
}

Param1 = ParamToggle("Price Field","Close|(H+L)/2",0);
Price = IIf(Param1==0,C,(H+L)/2);

//Stochastics
LongK = StochMom(Price,21,10,3);
LongD = EMA(LongK,4);
ShortK = StochMom(Price,7,3,3);
ShortD = EMA(ShortK,3);

//Colour Arrays
LongColour = IIf(LongK>LongD,colorGreen,colorRed);
ShortColour = IIf(ShortK>ShortD,colorBlue,colorOrange);

PlotOHLC(LongK,LongK,LongD,LongK,"",LongColour,styleCloud, -100, 100);
PlotOHLC(ShortK,ShortK,ShortD,ShortK,"",ShortColour,styleCloud, -100, 100);

Plot(50,"",colorGrey50,styleDashed|styleNoLabel);
Plot(60,"",colorGrey50,styleDashed|styleNoLabel);
Plot(-60,"",colorGrey50,styleDashed|styleNoLabel);
Plot(-50,"",colorGrey50,styleDashed|styleNoLabel);

/*
You can use minvalue, maxvalue in PlotOHLC:
PlotOHLC( ... styleCloud|styleOwnScale, -100, 100)
*/
_SECTION_END();

Panos

At 05:24 AM 23-09-2008 23-09-2008, you wrote:

>Must be my day for questions.
>
>
>
>If I create 2 indicators, let’s say a Stoch D and a Stoch K in the same 
>pane. Is there any way of color filling the gap between the 2 plotted
lines?
>
>
>
>Thanks again
>
>Tom
>
>

 

Reply via email to