could anyone convert this into NinjaTrader?
// Tape v1.0
// Author: TUMS
// Date: October 2008
// License: public domain
// Description: This program draws the 2 bar tapes
// http://elitetrader.com/vb/showthread...83#post2109583
//
// You are encouraged to post your enhancements on
// http://www.elitetrader.com/vb/showth...threadid=97684
inputs:
tape_color(lightgray);
variables:
slope(0),
id_tl_RTL(-1),
id_tl_LTL(-1),
outside_bar(false),
inside_bar(false),
RTL_tape_end(0),
LTL_tape_begin(0),
LTL_tape_end(0),
tape_width(0);
outside_bar = high > high[1] and low < low[1];
inside_bar = high <= high[1] and low >= low[1];
tape_width = maxlist(range, range[1]);
if time > begin_time and time < end_time then
begin
if outside_bar = false and inside_bar = false then
begin
if high > high[1] then
begin
slope = low - low[1];
RTL_tape_end = low + slope;
LTL_tape_begin = low[1] + tape_width;
LTL_tape_end = low + tape_width + slope;
id_tl_RTL = tl_new(date, time[1], low[1], date, time + barinterval, RTL_tape_end);
id_tl_LTL = tl_new(date, time[1], LTL_tape_begin, date, time + barinterval, LTL_tape_end );
tl_setcolor(id_tl_RTL, tape_color);
tl_setcolor(id_tl_LTL, tape_color);
end
else
if low < low[1] then
begin
slope = high[1] - high;
RTL_tape_end = high - slope;
LTL_tape_begin = high[1] - tape_width;
LTL_tape_end = high - tape_width - slope;
id_tl_RTL = tl_new(date, time[1], high[1], date, time + barinterval, RTL_tape_end);
id_tl_LTL = tl_new(date, time[1], LTL_tape_begin, date, time + barinterval, LTL_tape_end );
tl_setcolor(id_tl_RTL, tape_color);
tl_setcolor(id_tl_LTL, tape_color);
end;
end;
end;
Comment