Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
For everyone following this thread, I figured out a more "elegant" way to do this, which is now correct.
This will reset daily, regardless of timeframe (as long as the timeframe is lower than the midpoint you're tracking), as well as provides Daily, Weekly, and Monthly midpoints, as desired.
Lastly, this gives you the option to see the High and Low it's using or hide it, as needed, and rounds the Mid Point to the nearest tick value.
Here's what it looks like (showing the high and low, which you can hide):
Here's the code:
## Provided by @The_Dude_Trader on Stocktwits / Twitter##
## For personal use only##
## Come see more at @DTWCoachandDude on Stocktwits / Twitter / Facebook ##
## https://www.secretsociety7.com ##
def cap = GetAggregationPeriod() ;
def errorInAggregation =
timeFrame == timeFrame.DAY and cap >= AggregationPeriod.WEEK or
timeFrame == timeFrame.WEEK and cap >= AggregationPeriod.MONTH ;
Assert(!errorInAggregation, "timeFrame should be not less than current chart aggregation period") ;
if (isPeriodRolled) {
HI = high ;
LO = low ;
} else {
HI = if high > HI[1] then high else HI[1] ;
LO = if low < LO[1] then low else LO[1] ;
}
def NA = double.NaN ;
plot TheHI = if ShowHiLo then HI else NA ;
plot TheLO = if ShowHiLo then LO else NA ;
plot TheMid = round(((HI + LO) / 2) / ticksize(), 0) * ticksize();
The devil's in the details, as you already know, devildriver6. This indicator is quite elegant, and I love it, man. I have been looking for this for quite a while. You are da' man! Thank you very much!
You have made my dream come true ... I'd been searching for a means of creating a mid-point indicator for my TOS intraday futures charts and some midnight cyber-surfing landed me here at Futures IO and your kind contribution to traders unable to craft Think Script ... Kind folks like you make the internet a wonder-filled playground ... Thanks again, George J Nicholson
I had a simple version and this one really fits the bill. I struggled creating it on my own til I finally found my senses and found this one. Thanks devil