I start like this:
if ( CurrentBars[1] <= spLength || CurrentBars[1] <= rangeBollPeriod || CurrentBars[1] <= vmaVolatilityPeriod ) return;
{
if (BarsInProgress == 1)
{
supertrend calculation from 4H bars
if ( CurrentBar == 0 )
{
upTrend.Set(true);
StopLine.Set ( Closes[1][0] );
OuterLine.Set( Closes[1][0] );
CenterLine.Set( Closes[1][0] );
return;
}
if (FirstTickOfBar)
{
etc etc
then a keltner
RangeBollUpper.Set( KBT_KELTNER_V1( Closes[1] , rangeBollNumStdDev , rangeBollPeriod ).Upper[0] );
RangeBollLower.Set( KBT_KELTNER_V1( Closes[1] , rangeBollNumStdDev , rangeBollPeriod ).Lower[0] );
}
and color areas
if (BarsInProgress == 0)
{
if ( Closes[1][0] > StopLine[0] )
{
DrawRegion("SFColorRegion"+CurrentBar ,1,0, StopLine , FilterLine , Color.Transparent, Color.MediumSeaGreen, 1 );
etc etc
What im doing wrong?
Thx!
Comment