[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RT] N bar Box in TS 4.0



PureBytes Links

Trading Reference Links

Hi,

The only change that I made was to change the LColor input to a number like
2 for blue, or 6 for red etc and add a plot statement. The changed N Bar Box
code is below. The lines are not a neat little box like Clyde's. Another
indicator that does a similar thing is the Combine Days indicator shown here
with a Black plot. The code for it is below the N Bar box code.

Prosper


{Purpose:    Draw a box covering NBars with the bottom of the
             box corresponding to the Lowest Low in the NBars
             of the group and the top of the box being the
             Highest High in the group.

             Vertical lines are drawn at the beginning and end
             of the group of bars and extends from LL to HH.

 Use:        Display higher time frame on chart.

 Problems:   ONLY FOR TS2000 unless you add something to insure
             only the most recent 600 or so trendlines are
             drawn -- that would cover 150 groups.

             DO NOT APPLY TO A VERY LONG DATA SERIES AS IT WILL
             TAKE A VERY LONG TIME TO UPDATE ! ! !

 Author:     Clyde Lee, Copyright 2001

 Permission: This application for Omega Tradestation can be
             freely distributed with proper credit.
}

Input:  NBars(4),      {Number of bars to be included in box }
        Shift(0),      {Move starting bar by amount entered  }
        LColor(5),  {Line color for box                   }
        LSize(0);      {Line size for box                    }

Vars:   MBars(NBars-1),HH(0),LL(0);

If Mod(CurrentBar,NBars)=Shift then begin
  HH=Highest(H,NBars);
  LL=Lowest(L,Nbars);
  Value1=TL_New(Date[Mbars], Time[MBars], HH, Date, Time, HH);
  Value2=TL_New(Date[Mbars], Time[MBars], LL, Date, Time, LL);
  Value3=TL_New(Date[Mbars], Time[MBars], HH, Date[MBars], Time[MBars], LL);
  Value4=TL_New(Date, Time, HH, Date, Time, LL);
  TL_SetColor(Value1, LColor);
  TL_SetColor(Value2, LColor);
  TL_SetColor(Value3, LColor);
  TL_SetColor(Value4, LColor);
  TL_SetSize(Value1, LSize);
  TL_SetSize(Value2, LSize);
  TL_SetSize(Value3, LSize);
  TL_SetSize(Value4, LSize);
End;

If false then plot1(0,"false");



{
Study Name:  CombineDays
Study Type:    Indicator
Description:   Combine a number of days to produce a OHLC bar chart of those
days.
                       ie: Two day OHLC bar chart
Created:         March 23, 1995
}

Inputs: NumDays(5), Shift(0),offset(0);


IF FracPortion((CurrentBar+Shift) / NumDays) = 0 Then Begin
  Plot1(Open[NumDays -1]+Offset,"Open");
  Plot2(Highest(High,NumDays)+Offset,"High");
  Plot3(Lowest(Low,NumDays)+Offset,"Low");
  Plot4(Close+Offset,"Close");
END;



To unsubscribe from this group, send an email to:
realtraders-unsubscribe@xxxxxxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Attachment: Description: "NBB.gif"