MID price indicator for TOS - futures io
futures io



MID price indicator for TOS


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one smegey with 5 posts (0 thanks)
    2. looks_two devildriver6 with 3 posts (10 thanks)
    3. looks_3 Shortline with 2 posts (0 thanks)
    4. looks_4 Semifaded with 2 posts (0 thanks)
    1. trending_up 8,794 views
    2. thumb_up 12 thanks given
    3. group 12 followers
    1. forum 18 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

MID price indicator for TOS

(login for full post details)
  #1 (permalink)
 smegey 
Sydney
 
Experience: None
Platform: TOS
Trading: Futures
 
Posts: 6 since Jun 2011
Thanks: 1 given, 0 received

Hi,

Futurestrader71 talks about the 'mid' alot. I have been trying to implement this level on my TOS charts but cant figure it out. I tried to create a simple moving average with a look back of 78 periods (5 min chart) with a calculation of (H+L)/2. Doesnt seem right.

FT71 did tweet and say "it charts the average of the high & low throughout whatever session I have selected. Generally pit only" - This is in relation to E-Mini S&P500 futures.

Anyone know how to calculate this in a script or define it in a study in TOS. Thanks in advance.

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Reaching Customer Service
NinjaTrader
IKYP - How I solved email troubles on VPS
NinjaTrader
Asking Wall Street Billionaire for Investment Advice
Psychology and Money Management
 
 
(login for full post details)
  #2 (permalink)
devildriver6
Dallas, Texas
 
 
Posts: 43 since Jun 2015
Thanks: 2 given, 31 received


smegey View Post
Hi,

Futurestrader71 talks about the 'mid' alot. I have been trying to implement this level on my TOS charts but cant figure it out. I tried to create a simple moving average with a look back of 78 periods (5 min chart) with a calculation of (H+L)/2. Doesnt seem right.

FT71 did tweet and say "it charts the average of the high & low throughout whatever session I have selected. Generally pit only" - This is in relation to E-Mini S&P500 futures.

Anyone know how to calculate this in a script or define it in a study in TOS. Thanks in advance.

You need to first define the period in which you want the mid price.
Then, once you've established a starting point, you want the highest high and lowest low.

This will give you the mid point during RTH's....

Here's the code I have to do this:

input CapturePeriodStart = 0930;
input CapturePeriodEnd = 1615;

input StartPlotTime = 0930;
input EndPlotTime = 2359;

def CapturePeriodHasBegun = secondsFromTime(CapturePeriodStart) > 0;
def FirstBarOfCapturePeriod = !CapturePeriodHasBegun[1] and CapturePeriodHasBegun;
def PriorPeriod = secondsFromTime(CapturePeriodStart) > 0 or secondsFromTime(CapturePeriodEnd) < 0;
def PlotPeriod = secondsFromTime(StartPlotTime) > 0 && secondsTillTime(EndPlotTime) > 0;
rec PriorPeriodHigh = if IsNaN(PriorPeriodHigh[1]) or PriorPeriodHigh[1] < 2 then high
else if FirstBarOfCapturePeriod then high else if PriorPeriod && high > PriorPeriodHigh[1] then
high else PriorPeriodHigh[1];

rec PriorPeriodLow = if IsNaN(PriorPeriodLow[1]) or PriorPeriodLow[1] < 2 then low else
if FirstBarOfCapturePeriod then low else if PriorPeriod && low < PriorPeriodLow[1] then low else
PriorPeriodLow[1];

def TheHigh = if PlotPeriod && PriorPeriodHigh > 2 then PriorPeriodHigh else
double.nan;

def TheLow = if PlotPeriod && PriorPeriodLow > 2 then PriorPeriodLow else
double.nan;

plot midpoint = (thehigh + thelow) / 2;
midpoint.setdefaultColor(color.yellow);
midpoint.setlineWeight(3);

Reply With Quote
The following 2 users say Thank You to devildriver6 for this post:
 
(login for full post details)
  #3 (permalink)
 smegey 
Sydney
 
Experience: None
Platform: TOS
Trading: Futures
 
Posts: 6 since Jun 2011
Thanks: 1 given, 0 received


Thank you very much. Ill give this a try and see how it goes!

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
 smegey 
Sydney
 
Experience: None
Platform: TOS
Trading: Futures
 
Posts: 6 since Jun 2011
Thanks: 1 given, 0 received

Devildriver6 - Have you compared your script to FT71 charts? On his traderbites it seems very close but not the same. Just wondering if its me or indeed its a tad different. Perhaps its user error on my part....

Any thoughts? Tyvm again for this

Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
Semifaded
San Francisco Ca/USA
 
 
Posts: 10 since Jan 2018
Thanks: 0 given, 3 received

This midline is incorrect?

Reply With Quote
 
(login for full post details)
  #6 (permalink)
 smegey 
Sydney
 
Experience: None
Platform: TOS
Trading: Futures
 
Posts: 6 since Jun 2011
Thanks: 1 given, 0 received

Seems alright to me

Started this thread Reply With Quote
 
(login for full post details)
  #7 (permalink)
devildriver6
Dallas, Texas
 
 
Posts: 43 since Jun 2015
Thanks: 2 given, 31 received


smegey View Post
Seems alright to me


Yeah, not sure about Traderbites, but that's the mid price.
Do you know how his is calculated?

Reply With Quote
 
(login for full post details)
  #8 (permalink)
 smegey 
Sydney
 
Experience: None
Platform: TOS
Trading: Futures
 
Posts: 6 since Jun 2011
Thanks: 1 given, 0 received


devildriver6 View Post
Yeah, not sure about Traderbites, but that's the mid price.
Do you know how his is calculated?

By 'his' you mean FT71 I am assuming - I'd just tweet him or reach out to his prop desk and ask for the actual calc.

Started this thread Reply With Quote
 
(login for full post details)
  #9 (permalink)
Semifaded
San Francisco Ca/USA
 
 
Posts: 10 since Jan 2018
Thanks: 0 given, 3 received


devildriver6 View Post
Yeah, not sure about Traderbites, but that's the mid price.
Do you know how his is calculated?

hmmm.... I am looking at it right now. /ESh8 chart and the hi is 2748.5, low is 2723.75... so mid should be 2736.13.. and the midline is 2737.13. It is usually always off a point or so.

Reply With Quote
 
(login for full post details)
  #10 (permalink)
 Shortline 
Lake Stevens, WA
 
Experience: Intermediate
Platform: NinjaTrader, TOS, IB exec
Broker: Interactive Brokers
Trading: ES CL
 
Shortline's Avatar
 
Posts: 46 since Aug 2016
Thanks: 38 given, 43 received



Semifaded View Post
hmmm.... I am looking at it right now. /ESh8 chart and the hi is 2748.5, low is 2723.75... so mid should be 2736.13.. and the midline is 2737.13. It is usually always off a point or so.

The logic of the script combined with ToS methodology is causing the recursive function to start one bar later than intended.

If you set the following two inputs to 1 bar prior to what you actually want the script will work accurately:

CapturePeriodStart
StartPlotTime

For example, if you are using a 5 minute intraday chart, if you set the above tow parameters to 0925 the values will be correct.

Unfortunately, if you change timeframes without adjusting these parameters it the midline will be inaccurate again.

I'm sure there is some logic that could be built into the script but I did not take the time to investigate that, sorry.

Additional Note: I just realized that if the chart is not showing the extended trading hours session the above hack does not work. Back to the drawing board.

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote


futures io Trading Community Platforms and Indicators ThinkOrSwim > MID price indicator for TOS


Last Updated on September 29, 2022


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2022 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts