NexusFi: Find Your Edge


Home Menu

 





Monthly high low lines in ThinkorSwim


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one AheadBank53 with 4 posts (1 thanks)
    2. looks_two logosz with 1 posts (0 thanks)
    3. looks_3 amansinghbaveja with 1 posts (0 thanks)
    4. looks_4 tanky with 1 posts (0 thanks)
    1. trending_up 3,837 views
    2. thumb_up 1 thanks given
    3. group 11 followers
    1. forum 6 posts
    2. attach_file 1 attachments




 
Search this Thread

Monthly high low lines in ThinkorSwim

  #1 (permalink)
tanky
singapore
 
Posts: 3 since Oct 2019
Thanks Given: 0
Thanks Received: 0

Hi,

i am trying to draw the previous month high and low lines in thinkorswim chart but not sure how to do it. can anyone help? thank you.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
MC Advanced Simulated Trading.
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
What You Know vs How much you know about it
Traders Hideout
 
  #2 (permalink)
 AheadBank53 
 
Posts: 4 since Jan 2011

In it's simplest form:

plot mthHi = High(period = aggregationPeriod.MONTH)[1];
plot mthLo = Low(period = "MONTH")[1]; #variation on the period definition

mthHi.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
mthHi.SetDefaultColor(Color.GREEN);
mthLo.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
mthLo.SetDefaultColor(Color.RED);

The code above will plot the Highs and lows of every months.

Or you could use ToS DailyHighLow prebuilt study and change the period from DAY to MONTH in the settings. The prebuilt study has more functioinality.

Reply With Quote
  #3 (permalink)
kele4957
Akron, Ohio
 
Posts: 2 since Jan 2021
Thanks Given: 0
Thanks Received: 1


Thanks for posting this code for monthly highs and lows. I am looking for a way to plot two horizontal lines for each calendar month's highest open and lowest open. I couldn't figure out how to modify your code for that purpose. Could you show me the code here? It is highly appreciated.
I just guess maybe add the type of data there? Thank you!

plot mthHi = High(period = aggregationPeriod.MONTH)[1];

Reply With Quote
  #4 (permalink)
amansinghbaveja
chandigarh, India
 
Posts: 1 since Aug 2023
Thanks Given: 0
Thanks Received: 0

Hi
Thanks for the code. It works perfect.
It plots high/low of every past month. is it possible to plot only for the previous month?
Thanks

Reply With Quote
  #5 (permalink)
 AheadBank53 
 
Posts: 4 since Jan 2011

To amansinghbaveja

Sorry for the late reply. I haven't been very active on this forum. In case you still need it, here's the code you are looking for:

input aggPeriod = aggregationPeriod.MONTH;
input showOnlyLastPeriod = yes; # TD Ameritrade IP Company, Inc. (c) 2011-2023
input offset = 0;

plot mthHi;
plot mthLo;

mthHi.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
mthHi.SetDefaultColor(Color.GREEN);
mthLo.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
mthLo.SetDefaultColor(Color.RED);

# TD Ameritrade IP Company, Inc. (c) 2011-2023
if showOnlyLastPeriod and !IsNaN(close(period = aggPeriod)[-1]) {
mthHi = Double.NaN;
mthLo = Double.NaN;
} else {
mthHi = high(period = aggPeriod)[offset];
mthLo = low(period = aggPeriod)[offset];
}
# TD Ameritrade IP Company, Inc. (c) 2011-2023

Please note that some of this code was created by TD as noted

Attached Thumbnails
Click image for larger version

Name:	Monthly HiLo Bands.PNG
Views:	26
Size:	43.0 KB
ID:	336415  
Reply With Quote
  #6 (permalink)
 AheadBank53 
 
Posts: 4 since Jan 2011

Hello kele4957

I apologize for the delayed response. I haven't been on this site for some time.

If you still need the code modifications, I will gladly investigate how to do it. I don't have an answer for you at this time, unfortunately.

Reply With Quote
  #7 (permalink)
 AheadBank53 
 
Posts: 4 since Jan 2011

It looks like we're losing access to ThinkOrSwin in Canada starting February 2024, so I will not likely be able to provide any more help with ToS... sorry.

Reply With Quote




Last Updated on November 25, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts