Simple Coding Help - No Promise.

anml

Active Member
Hi guys , can anyone help me in how to scan realtime in zerodha pi for ema crossover in 2,3 time frames at a time , say
50-200 ema cross over 1 hr candles and 15 min candles for FNO stocks only ,is it possible ?
and also please guide how to get alert for crossing some levels in diferent stcoks , ( ie, say im watching 10 stocks for buy sell levels with eod charts in prior day and when market opens , if im watching 2,3 stocks for that levels to cross which looks ok at the time of opeing , but the others doing well than these after sometime ,when im concentrating in these stocks , so asking how to manage to keep eye in all stoks which going in my favour way ?
Thanks.
 

toocool

Well-Known Member
it can be done bro, :happy:
1st click on EMA_with_same_tf to show those emas,
n toggle off diff_timeframe_ema
c pic one

then scroll down n change the periods in ema1,ema2, n so on, the timeframe will remain the same :happy:
c pic two
can you please check again and see if you can plot 15 minutes based 20 ,50, 100 ,200 ema on 1 minute banknifty chart ??
 

toocool

Well-Known Member
this is di

this is different TF with diff range of EMA on diff TF :( for this another code will be required :(
no what i mean is

1 minute chart

on that 5 minute 20 period ema

15 minute 20 period ema

hourly 20 period ema

2 hourly 20 period ema

4 hourly 20 period ema

this should be possible

then we get what we need

all higher time frame minutes will be customized and all periods for ema will be customised

i dont know if i am describing correctly
 

Romeo1998

Well-Known Member
no what i mean is

1 minute chart

on that 5 minute 20 period ema

15 minute 20 period ema

hourly 20 period ema

2 hourly 20 period ema

4 hourly 20 period ema

this should be possible

then we get what we need

all higher time frame minutes will be customized and all periods for ema will be customised

i dont know if i am describing correctly
yes, this can be done
switch off EMA_with_same _TF
and
switch on Diff_timeframe_but_same_value
then change periods of that EMAs
c the attached pic :)
its on 1 min TF
5 min 20 Ema
15 min 20 ema
1hr 20 ema
n so on :)
 
Last edited:

toocool

Well-Known Member
yes, this can be done
switch off EMA_with_same _TF
and
switch on Diff_timeframe_but_same_value
then change periods of that EMAs
c the attached pic :)
its on 1 min TF
5 min 20 Ema
15 min 20 ema
1hr 20 ema
n so on :)
but it cant do



for example

1 minute chart....................

15 minute 20 ema

15 minute 50 ema

30 minute 100 ema

30 minute 200 ema
 

Romeo1998

Well-Known Member
but it cant do



for example

1 minute chart....................

15 minute 20 ema

15 minute 50 ema

30 minute 100 ema

30 minute 200 ema
ok, now i understood :happy: u want to change the periods as well as the timeframe on the same EMA:happy:

i tried to do it, but not getting proper results :(
Code:
SetChartOptions(0,chartShowArrows|chartShowDates,0);
_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_BEGIN("EMA1");
i=Interval(0)/60;  // 1 min
TF=Param("TF in mins",i,1,10000,1); // change timeframe
P=Param("Periods",5,1,1000,1);
TimeFrameSet(tf);
m= EMA(Close,P) ;
Plot(TimeFrameExpand(m, TF), "", ParamColor( "EMA1", colorRed ), styleLine|styleThick);
TimeFrameRestore();
_SECTION_END();
 
i want EMA 13 >EMA34> SMA 200 STOCKS IN DAILY TIME FRAME for buy entry

whenever EMA 13 > EMA 34 (IN A BOUCEBACK..) , i want the alerts in scanner

is it possible afl scanner
 
[/IMG] hi dear friends
i have 2 error when i run the afl?my amibroker is 6.20 here is the error and code


png.png

Code:
_SECTION_BEGIN("Automatic linear trend channel edited");
// Automatic Linear Trend Channel (edited)
// original author Edward Pottasch
// Trend is defined using code found on the net
// see also: http://www.youtube.com/watch?v=HWPSqwEkN64
// Amibroker AFL code by Edward Pottasch, November 2011
// edited by Anderson Wilson, July 2012
// some symbols makes yybull and yybear infinite,
// added IsFinite(yybull) AND IsFinite(yybear)
// before plotting Channel

kk = Optimize( "mult", Param( "mult", 1.25, 1, 2, 0.25 ), 1, 2, 0.25 );
Per = Optimize( "period", Param( "period", 10, 5, 50, 1 ), 5, 50, 1 );
sdfact = Param( "Standard Deviation Factor", 2, 0.5, 5, 0.1 );
offset = Param( "Offset", 2, 1, 50, 1 );
tc = ParamList( "Channel Display", List = "No Channel|Channel|ChannelRT|Both Channels", 1 );
ms = ParamToggle( "Trend", "Regular|Smoothed", 1 );

x = Cum( 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 ) );

if ( ms == 0 )
{
nm = ( H - L );
j = ( O + H + L + C ) / 4;
}
else
{
nm = ( HaHigh - HaLow );
j = ( HaOpen + HaHigh + HaLow + HaClose ) / 4;
}

rfsctor = WMA( nm, Per );

revers = kk * rfsctor;
Trend = 1;
NW[0] = 0;

for ( i = 1;i < BarCount;i++ )
{
if ( Trend[i-1] == 1 )
{
if ( j < NW[i-1] )
{
Trend = -1;
NW = j + Revers;
}
else
{
Trend = 1;

if ( ( j - Revers ) > NW[i-1] )
{
NW = j - Revers;
}
else
{
NW = NW[i-1];
}
}
}

if ( Trend[i-1] == -1 )
{
if ( j > NW[i-1] )
{
Trend = 1;
NW = j - Revers;
}
else
{
Trend = -1;

if ( ( j + Revers ) < NW[i-1] )
{
NW[i] = j[i] + Revers[i];
}
else
{
NW[i] = NW[i-1];
}
}
}
}

cp = ( H + L ) / 2;

TrendUp = IIf( Trend == 1, Trend, 0 );
TrendDown = IIf( Trend == -1, Trend, 0 );
totalTrend = IIf( TrendUp, TrendUp, TrendDown );
dtotalTrend = totalTrend - Ref( totalTrend, -1 );
vtotalTrend = ValueWhen( dtotalTrend, dtotalTrend );
cbull = vtotalTrend > 0 AND Ref( vtotalTrend, -1 ) < 0;
cbull = Ref( cbull, 1 );
cbear = vtotalTrend < 0 AND Ref( vtotalTrend, -1 ) > 0;
cbear = Ref( cbear, 1 );
cbull = vtotalTrend > 0 AND Ref( vtotalTrend, -1 ) < 0;
cbull = Ref( cbull, 1 );
cbull[BarCount-1] = 1;
cbear = vtotalTrend < 0 AND Ref( vtotalTrend, -1 ) > 0;
cbear = Ref( cbear, 1 );
cbear[BarCount-1] = 1;
nwbull = Ref( Flip( cbull, cbear ), -1 );
nwbear = Ref( Flip( cbear, cbull ), -1 );

xxbull = BarsSince( cbull );
xxbull[BarCount-1] = xxbull[BarCount-2] + 1;
aaabull = LinRegIntercept( cp, xxbull );
bbbbull = LinRegSlope( cp, xxbull );
daabull = Ref( ValueWhen( cbear, aaabull, 0 ), -1 );
dbbbull = Ref( ValueWhen( cbear, bbbbull, 0 ), -1 );
yybull = daabull + dbbbull * ( xxbull - 1 );
yybull = IIf( xxbull > Max( offset, 1 ), yybull, Null );
wdbull = sdfact * StdErr( cp, xxbull );
wdbull = Ref( ValueWhen( cbear, wdbull, 0 ), -1 );

xxbear = BarsSince( cbear );
xxbear[BarCount-1] = xxbear[BarCount-2] + 1;
aaabear = LinRegIntercept( cp, xxbear );
bbbbear = LinRegSlope( cp, xxbear );
daabear = Ref( ValueWhen( cbull, aaabear, 0 ), -1 );
dbbbear = Ref( ValueWhen( cbull, bbbbear, 0 ), -1 );
yybear = daabear + dbbbear * ( xxbear - 1 );
yybear = IIf( xxbear > Max( offset, 1 ), yybear, Null );
wdbear = sdfact * StdErr( cp, xxbear );
wdbear = Ref( ValueWhen( cbull, wdbear, 0 ), -1 );

llbull = LinearReg( cp, xxbull );
llbull = IIf( xxbull > Max( Offset, 1 ), llbull, Null );
llbullp = LinearReg( cp, xxbull ) + sdfact * StdErr( cp, xxbull );
llbullp = IIf( xxbull > Max( Offset, 2 ), llbullp, Null );
llbullm = LinearReg( cp, xxbull ) - sdfact * StdErr( cp, xxbull );
llbullm = IIf( xxbull > Max( Offset, 2 ), llbullm, Null );
llbear = LinearReg( cp, xxbear );
llbear = IIf( xxbear > Max( Offset, 1 ), llbear, Null );
llbearp = LinearReg( cp, xxbear ) + sdfact * StdErr( cp, xxbear );
llbearp = IIf( xxbear > Max( Offset, 2 ), llbearp, Null );
llbearm = LinearReg( cp, xxbear ) - sdfact * StdErr( cp, xxbear );
llbearm = IIf( xxbear > Max( Offset, 2 ), llbearm, Null );

SetChartBkColor( ParamColor( "Background Color", colorBlack ) );
SetChartOptions( 0, chartShowDates );
SetBarFillColor( IIf( C > O, ParamColor( "Candle UP Color", colorGreen ), IIf( C <= O, ParamColor( "Candle Down Color", colorRed ), colorLightGrey ) ) );
Plot( C, "Price", IIf( C > O, ParamColor( "Wick UP Color", colorDarkGreen ), IIf( C <= O, ParamColor( "Wick Down Color", colorDarkRed ), colorLightGrey ) ), 64, 0, 0, 0, 0 );
PlotShapes( IIf( x == BarCount, shapeSmallSquare, shapeNone ), colorWhite, 0, j, 0 );
Plot( IIf( NW < j, NW, Null ), "\ntrailLong", ParamColor( "ColorTrailLong", colorGreen ), styleStaircase | styleDots );
Plot( IIf( NW > j, NW, Null ), "\ntrailShort", ParamColor( "ColorTrailShort", colorRed ), styleStaircase | styleDots );


switch ( tc )
{
case( "No Channel" ):
break;
case( "Channel" ):
Plot( IIf( nwbull AND IsFinite(yybull), yybull, Null ), "", bbb = ColorRGB( 0, 255, 0 ), styleDashed );
Plot( IIf( nwbull AND IsFinite(yybull), yybull + wdbull, Null ), "", bbb, styleThick );
Plot( IIf( nwbull AND IsFinite(yybull), yybull - wdbull, Null ), "", bbb, styleThick );
Plot( IIf( nwbear AND IsFinite(yybear), yybear, Null ), "", sss = ColorRGB( 255, 0, 0 ), styleDashed );
Plot( IIf( nwbear AND IsFinite(yybear), yybear + wdbear, Null ), "", sss, styleThick );
Plot( IIf( nwbear AND IsFinite(yybear), yybear - wdbear, Null ), "", sss, styleThick );
PlotOHLC( IIf( nwbull AND IsFinite(yybull), yybull + wdbull, Null ),
IIf( nwbull AND IsFinite(yybull), yybull + wdbull, Null ),
IIf( nwbull AND IsFinite(yybull), yybull - wdbull, Null ),
IIf( nwbull AND IsFinite(yybull), yybull - wdbull, Null ),
"", ColorRGB( 10, 15, 10 ), styleCloud | styleNoLabel, 0, 0, 0, -1 );
PlotOHLC( IIf( nwbear AND IsFinite(yybear), yybear + wdbear, Null ),
IIf( nwbear AND IsFinite(yybear), yybear + wdbear, Null ),
IIf( nwbear AND IsFinite(yybear), yybear - wdbear, Null ),
IIf( nwbear AND IsFinite(yybear), yybear - wdbear, Null ),
"", ColorRGB( 15, 10, 10 ), styleCloud | styleNoLabel, 0, 0, 0, -1 );

_N(Title = VarGetText("Title") +
StrFormat(
", nwbull %g, yybull %g, nwbear %g, yybear %g wdbull %g",
nwbull, yybull, nwbear, yybear, wdbull

)
);
break;
case( "ChannelRT" ):
Plot( IIf( nwbull, llbull, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbull, llbullp, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbull, llbullm, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbear, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbearp, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbearm, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
PlotOHLC( IIf( nwbull, llbullp, Null ), IIf( nwbull, llbullp, Null ), IIf( nwbull, llbullm, Null ),
IIf( nwbull, llbullm, Null ), "", ColorRGB( 10, 15, 10 ), styleCloud | styleNoLabel, 0, 0, 0, -1 );
PlotOHLC( IIf( nwbear, llbearp, Null ), IIf( nwbear, llbearp, Null ), IIf( nwbear, llbearm, Null ),
IIf( nwbear, llbearm, Null ), "", ColorRGB( 15, 10, 10 ), styleCloud | styleNoLabel, 0, 0, 0, -1 );
break;
case( "Both Channels" ):
Plot( IIf( nwbull, yybull, Null ), "", bbb = ColorRGB( 0, 255, 0 ), styleLine );
Plot( IIf( nwbull, yybull + wdbull, Null ), "", bbb, styleThick );
Plot( IIf( nwbull, yybull - wdbull, Null ), "", bbb, styleThick );
Plot( IIf( nwbear, yybear, Null ), "", sss = ColorRGB( 255, 0, 0 ), styleLine );
Plot( IIf( nwbear, yybear + wdbear, Null ), "", sss, styleThick );
Plot( IIf( nwbear, yybear - wdbear, Null ), "", sss, styleThick );
Plot( IIf( nwbull, llbull, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbull, llbullp, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbull, llbullm, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbear, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbearp, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbearm, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
break;
}
_SECTION_END();[/i][/i][/i][/i]
http://www.traderji.com/community/threads/automatic-linear-trend-channel-afl.90055/
thanxx
 

Romeo1998

Well-Known Member
Dear friend,
use this code :happy:
now u wont get any errors :happy:
Code:
_SECTION_BEGIN("Automatic linear trend channel edited");
// Automatic Linear Trend Channel (edited)
// original author Edward Pottasch
// Trend is defined using code found on the net
// see also: http://www.youtube.com/watch?v=HWPSqwEkN64
// Amibroker AFL code by Edward Pottasch, November 2011
// edited by Anderson Wilson, July 2012
// some symbols makes yybull and yybear infinite,
// added IsFinite(yybull) AND IsFinite(yybear)
// before plotting Channel

kk = Optimize( "mult", Param( "mult", 1.25, 1, 2, 0.25 ), 1, 2, 0.25 );
Per = Optimize( "period", Param( "period", 10, 5, 50, 1 ), 5, 50, 1 );
sdfact = Param( "Standard Deviation Factor", 2, 0.5, 5, 0.1 );
offset = Param( "Offset", 2, 1, 50, 1 );
tc = ParamList( "Channel Display", List = "No Channel|Channel|ChannelRT|Both Channels", 1 );
ms = ParamToggle( "Trend", "Regular|Smoothed", 1 );

x = Cum( 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 ) );

if ( ms == 0 )
{
nm = ( H - L );
j = ( O + H + L + C ) / 4;
}
else
{
nm = ( HaHigh - HaLow );
j = ( HaOpen + HaHigh + HaLow + HaClose ) / 4;
}

rfsctor = WMA( nm, Per );

revers = kk * rfsctor;
Trend = 1;
NW[0] = 0;

for ( i = 1;i < BarCount;i++ )
{
if ( Trend[i-1] == 1 )
{
if ( j[i] < NW[i-1] )
{
Trend = -1;
NW = j + Revers;
}
else
{
Trend = 1;

if ( ( j[i] - Revers[i] ) > NW[i-1] )
{
NW = j - Revers;
}
else
{
NW = NW[i-1];
}
}
}

if ( Trend[i-1] == -1 )
{
if ( j[i] > NW[i-1] )
{
Trend = 1;
NW = j - Revers;
}
else
{
Trend = -1;

if ( ( j[i] + Revers[i] ) < NW[i-1] )
{
NW[i] = j[i] + Revers[i];
}
else
{
NW[i] = NW[i-1];
}
}
}
}

cp = ( H + L ) / 2;

TrendUp = IIf( Trend == 1, Trend, 0 );
TrendDown = IIf( Trend == -1, Trend, 0 );
totalTrend = IIf( TrendUp, TrendUp, TrendDown );
dtotalTrend = totalTrend - Ref( totalTrend, -1 );
vtotalTrend = ValueWhen( dtotalTrend, dtotalTrend );
cbull = vtotalTrend > 0 AND Ref( vtotalTrend, -1 ) < 0;
cbull = Ref( cbull, 1 );
cbear = vtotalTrend < 0 AND Ref( vtotalTrend, -1 ) > 0;
cbear = Ref( cbear, 1 );
cbull = vtotalTrend > 0 AND Ref( vtotalTrend, -1 ) < 0;
cbull = Ref( cbull, 1 );
cbull[BarCount-1] = 1;
cbear = vtotalTrend < 0 AND Ref( vtotalTrend, -1 ) > 0;
cbear = Ref( cbear, 1 );
cbear[BarCount-1] = 1;
nwbull = Ref( Flip( cbull, cbear ), -1 );
nwbear = Ref( Flip( cbear, cbull ), -1 );

xxbull = BarsSince( cbull );
xxbull[BarCount-1] = xxbull[BarCount-2] + 1;
aaabull = LinRegIntercept( cp, xxbull );
bbbbull = LinRegSlope( cp, xxbull );
daabull = Ref( ValueWhen( cbear, aaabull, 0 ), -1 );
dbbbull = Ref( ValueWhen( cbear, bbbbull, 0 ), -1 );
yybull = daabull + dbbbull * ( xxbull - 1 );
yybull = IIf( xxbull > Max( offset, 1 ), yybull, Null );
wdbull = sdfact * StdErr( cp, xxbull );
wdbull = Ref( ValueWhen( cbear, wdbull, 0 ), -1 );

xxbear = BarsSince( cbear );
xxbear[BarCount-1] = xxbear[BarCount-2] + 1;
aaabear = LinRegIntercept( cp, xxbear );
bbbbear = LinRegSlope( cp, xxbear );
daabear = Ref( ValueWhen( cbull, aaabear, 0 ), -1 );
dbbbear = Ref( ValueWhen( cbull, bbbbear, 0 ), -1 );
yybear = daabear + dbbbear * ( xxbear - 1 );
yybear = IIf( xxbear > Max( offset, 1 ), yybear, Null );
wdbear = sdfact * StdErr( cp, xxbear );
wdbear = Ref( ValueWhen( cbull, wdbear, 0 ), -1 );

llbull = LinearReg( cp, xxbull );
llbull = IIf( xxbull > Max( Offset, 1 ), llbull, Null );
llbullp = LinearReg( cp, xxbull ) + sdfact * StdErr( cp, xxbull );
llbullp = IIf( xxbull > Max( Offset, 2 ), llbullp, Null );
llbullm = LinearReg( cp, xxbull ) - sdfact * StdErr( cp, xxbull );
llbullm = IIf( xxbull > Max( Offset, 2 ), llbullm, Null );
llbear = LinearReg( cp, xxbear );
llbear = IIf( xxbear > Max( Offset, 1 ), llbear, Null );
llbearp = LinearReg( cp, xxbear ) + sdfact * StdErr( cp, xxbear );
llbearp = IIf( xxbear > Max( Offset, 2 ), llbearp, Null );
llbearm = LinearReg( cp, xxbear ) - sdfact * StdErr( cp, xxbear );
llbearm = IIf( xxbear > Max( Offset, 2 ), llbearm, Null );

SetChartBkColor( ParamColor( "Background Color", colorBlack ) );
SetChartOptions( 0, chartShowDates );
SetBarFillColor( IIf( C > O, ParamColor( "Candle UP Color", colorGreen ), IIf( C <= O, ParamColor( "Candle Down Color", colorRed ), colorLightGrey ) ) );
Plot( C, "Price", IIf( C > O, ParamColor( "Wick UP Color", colorDarkGreen ), IIf( C <= O, ParamColor( "Wick Down Color", colorDarkRed ), colorLightGrey ) ), 64, 0, 0, 0, 0 );
PlotShapes( IIf( x == BarCount, shapeSmallSquare, shapeNone ), colorWhite, 0, j, 0 );
Plot( IIf( NW < j, NW, Null ), "\ntrailLong", ParamColor( "ColorTrailLong", colorGreen ), styleStaircase | styleDots );
Plot( IIf( NW > j, NW, Null ), "\ntrailShort", ParamColor( "ColorTrailShort", colorRed ), styleStaircase | styleDots );


switch ( tc )
{
case( "No Channel" ):
break;
case( "Channel" ):
Plot( IIf( nwbull AND IsFinite(yybull), yybull, Null ), "", bbb = ColorRGB( 0, 255, 0 ), styleDashed );
Plot( IIf( nwbull AND IsFinite(yybull), yybull + wdbull, Null ), "", bbb, styleThick );
Plot( IIf( nwbull AND IsFinite(yybull), yybull - wdbull, Null ), "", bbb, styleThick );
Plot( IIf( nwbear AND IsFinite(yybear), yybear, Null ), "", sss = ColorRGB( 255, 0, 0 ), styleDashed );
Plot( IIf( nwbear AND IsFinite(yybear), yybear + wdbear, Null ), "", sss, styleThick );
Plot( IIf( nwbear AND IsFinite(yybear), yybear - wdbear, Null ), "", sss, styleThick );
PlotOHLC( IIf( nwbull AND IsFinite(yybull), yybull + wdbull, Null ),
IIf( nwbull AND IsFinite(yybull), yybull + wdbull, Null ),
IIf( nwbull AND IsFinite(yybull), yybull - wdbull, Null ),
IIf( nwbull AND IsFinite(yybull), yybull - wdbull, Null ),
"", ColorRGB( 10, 15, 10 ), styleCloud | styleNoLabel, 0, 0, 0, -1 );
PlotOHLC( IIf( nwbear AND IsFinite(yybear), yybear + wdbear, Null ),
IIf( nwbear AND IsFinite(yybear), yybear + wdbear, Null ),
IIf( nwbear AND IsFinite(yybear), yybear - wdbear, Null ),
IIf( nwbear AND IsFinite(yybear), yybear - wdbear, Null ),
"", ColorRGB( 15, 10, 10 ), styleCloud | styleNoLabel, 0, 0, 0, -1 );

_N(Title = VarGetText("Title") +
StrFormat(
", nwbull %g, yybull %g, nwbear %g, yybear %g wdbull %g",
nwbull, yybull, nwbear, yybear, wdbull

)
);
break;
case( "ChannelRT" ):
Plot( IIf( nwbull, llbull, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbull, llbullp, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbull, llbullm, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbear, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbearp, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbearm, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
PlotOHLC( IIf( nwbull, llbullp, Null ), IIf( nwbull, llbullp, Null ), IIf( nwbull, llbullm, Null ),
IIf( nwbull, llbullm, Null ), "", ColorRGB( 10, 15, 10 ), styleCloud | styleNoLabel, 0, 0, 0, -1 );
PlotOHLC( IIf( nwbear, llbearp, Null ), IIf( nwbear, llbearp, Null ), IIf( nwbear, llbearm, Null ),
IIf( nwbear, llbearm, Null ), "", ColorRGB( 15, 10, 10 ), styleCloud | styleNoLabel, 0, 0, 0, -1 );
break;
case( "Both Channels" ):
Plot( IIf( nwbull, yybull, Null ), "", bbb = ColorRGB( 0, 255, 0 ), styleLine );
Plot( IIf( nwbull, yybull + wdbull, Null ), "", bbb, styleThick );
Plot( IIf( nwbull, yybull - wdbull, Null ), "", bbb, styleThick );
Plot( IIf( nwbear, yybear, Null ), "", sss = ColorRGB( 255, 0, 0 ), styleLine );
Plot( IIf( nwbear, yybear + wdbear, Null ), "", sss, styleThick );
Plot( IIf( nwbear, yybear - wdbear, Null ), "", sss, styleThick );
Plot( IIf( nwbull, llbull, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbull, llbullp, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbull, llbullm, Null ), "", colorGreen, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbear, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbearp, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
Plot( IIf( nwbear, llbearm, Null ), "", colorRed, styleDashed, 0, 1, 0, 1 );
break;
}
_SECTION_END();
 

Similar threads