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 tanky with 1 posts (0 thanks)
    3. looks_3 kele4957 with 1 posts (0 thanks)
    4. looks_4 logosz with 1 posts (0 thanks)
    1. trending_up 3,754 views
    2. thumb_up 1 thanks given
    3. group 11 followers
    1. forum 6 posts
    2. attach_file 1 attachments




 
 

Monthly high low lines in ThinkorSwim

 
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.


Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
18 thanks
The Program
18 thanks
 
 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.

 
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];

 
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

 
 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:	20
Size:	43.0 KB
ID:	336415  
 
 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.

 
 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.


 



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