AFL - last days MID level + cloud

#1
Hi members,

please help me plotting cloud funtion in below afl. Above last days mid level all green and below all red.

Below is afl

//*************************************

_SECTION_BEGIN("");
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("PreDay Mid");
function CDL( array )
{
doy = DayOfYear();
Lastdoy = doy == LastValue( doy );
Dayline = array * Lastdoy;

return IIf( Dayline, Dayline, Null );
}

//TIME FRAME CALCULATION
H1 = TimeFrameGetPrice( "H", inDaily, -1 ); // yesterdays high
L1 = TimeFrameGetPrice( "L", inDaily, -1 ); // low
DayO = TimeFrameGetPrice( "-1", inDaily ); // current day open

M1 = (H1+L1)/2;

//PLOTS
Plot( cdl( M1 ), "", colorGrey50, styleLine);
_SECTION_END();
 

amitrandive

Well-Known Member
#2
Hi members,

please help me plotting cloud funtion in below afl. Above last days mid level all green and below all red.

Below is afl

//*************************************

_SECTION_BEGIN("");
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("PreDay Mid");
function CDL( array )
{
doy = DayOfYear();
Lastdoy = doy == LastValue( doy );
Dayline = array * Lastdoy;

return IIf( Dayline, Dayline, Null );
}

//TIME FRAME CALCULATION
H1 = TimeFrameGetPrice( "H", inDaily, -1 ); // yesterdays high
L1 = TimeFrameGetPrice( "L", inDaily, -1 ); // low
DayO = TimeFrameGetPrice( "-1", inDaily ); // current day open

M1 = (H1+L1)/2;

//PLOTS
Plot( cdl( M1 ), "", colorGrey50, styleLine);
_SECTION_END();
Try this
:thumb:

Code:
_SECTION_BEGIN("");
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("PreDay Mid");
function CDL( array )
{
doy = DayOfYear();
Lastdoy = doy == LastValue( doy );
Dayline = array * Lastdoy;

return IIf( Dayline, Dayline, Null );
}

//TIME FRAME CALCULATION
H1 = TimeFrameGetPrice( "H", inDaily, -1 ); // yesterdays high
L1 = TimeFrameGetPrice( "L", inDaily, -1 ); // low
DayO = TimeFrameGetPrice( "-1", inDaily ); // current day open
H0 = TimeFrameGetPrice( "H", inDaily, 0 );
L0 = TimeFrameGetPrice( "L", inDaily, 0 );
M1 = (H1+L1)/2;
//PLOTS
Plot( M1 , "", colorBlack, styleDots);
PlotOHLC(M1,M1,H0,H0,"",colorBrightGreen,styleCloud);
PlotOHLC(M1,M1,L0,L0,"",colorOrange,styleCloud);
_SECTION_END();
 
#3
Thanks amitrandive,

That worked, but it plots the cloud color only till the price movement.

Can it be plotted for the complete chart background color. Below mid all red n above all green as in chart background color.

Thanks man for all your help.
 

amitrandive

Well-Known Member
#4
Thanks amitrandive,

That worked, but it plots the cloud color only till the price movement.

Can it be plotted for the complete chart background color. Below mid all red n above all green as in chart background color.

Thanks man for all your help.
Aman

I do not know how to cover the entire chart.I tried to put in the yearly high nad low as the boundary, but that also does not cover the entire area and also the price chart gets compressed by doing that.
 
#5
Aman

I do not know how to cover the entire chart.I tried to put in the yearly high nad low as the boundary, but that also does not cover the entire area and also the price chart gets compressed by doing that.
*************

No problems, rather I would say the pane color should change completely.

If I find some solution, I will post here. Till then, lets keep on searching.

Thanks.
 

Similar threads