DailyLines for Swing Trades in ThinkorSwim

rlohmeyer

Member
Hi,

I am not a coder but through cobbling together a basic indicator I have used at least 30 years and with the help of #Nube, #Korygill #BenTen and #JimmyMack I have what I need. Nothing fancy here. The code is below. Use if it is useful. As a swing trader since 1987, support and resistance lines has been my go to. I have included the picture of a chart with the indicator setup.

Regards,
Bob

Code:
#DailyCOHL_Lines

input aggregationPeriod = AggregationPeriod.DAY;
input showOnlyLastPeriod = yes;

plot DailyOpen = open(period = aggregationPeriod);

DailyOpen.SetDefaultColor(Color.YELLOW);
DailyOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

plot ystdClose = close(period = aggregationPeriod)[1];

ystdClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ystdClose.SetDefaultColor(Color.Dark_Orange);
ystdClose.SetLineWeight(1);

plot DailyHigh = high(period = aggregationPeriod);

DailyHigh.SetDefaultColor(Color.Green);
DailyHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

plot ystdHigh = high(period = aggregationPeriod)[1];

ystdHigh.SetDefaultColor(Color.Dark_Green);
ystdHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

plot DailyLow = low(period = aggregationPeriod);

DailyLow.SetDefaultColor(Color.Red);
DailyLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

plot ystdLow = low(period = aggregationPeriod)[1];

ystdLow.SetDefaultColor(Color.Dark_Red);
ystdLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
 

rlohmeyer

Member
Thanks....here is another one that is on my 1 minute trading chart. It displays 5 higher time frame moving averages. This one is also extremely useful. Below are 2 images of trading that took place today in one stock. This shows exactly how useful this indicator was. Again, the code is simple and cobbled together from another indicator or 2. The code is below the 2 images. With all the things you can do with Thinkscript, often the old standbys are the best. The EMAs used are 10,20,50,100,200. These are watched, can become targets as you will see in the 2 charts below, and will become areas of intense trading when reached.

JlkuuCd.jpg

3cCp1bU.jpg


Code:
# MTF Moving Average
input Period = aggregationPeriod.DAY;
input AvgType = averageType.EXPONENTIAL;
input L1 = 10;
input L2 = 20;
input L3 = 50;
input L4 = 100;
input L5 = 200;

plot AVG1 = MovingAverage(AvgType, close(period = Period), L1);
AVG1.setdefaultcolor(color.yellow);
plot AVG2 = MovingAverage(AvgType, close(period = Period), L2);
AVG2.SetDefaultColor(CreateColor(255,204,0));
plot AVG3 = MovingAverage(AvgType, close(period = Period), L3);
AVG3.SetDefaultColor(CreateColor(255, 153, 0));
plot AVG4 = MovingAverage(AvgType, close(period = Period), L4);
AVG4.SetDefaultColor(CreateColor(255, 102, 0));
plot AVG5 = MovingAverage(AvgType, close(period = Period), L5);
AVG4.SetDefaultColor(CreateColor(255, 51, 0));
 
Thread starter Similar threads Forum Replies Date
Mightymorphinchris Short Scalp or Swing Strategy? Strategies 1
M Swing Beta Test Playground 0
R swing trading setup Questions 4
R Scanner for Swing Wave Questions 1
R Scanner for swing wave Questions 2

Similar threads

Top