Help finishing a script plotting opening 30 min levels - futures io
futures io futures trading



Help finishing a script plotting opening 30 min levels


Discussion in ThinkOrSwim

Updated by kjhosken
    1. trending_up 376 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 replies
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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
 

Help finishing a script plotting opening 30 min levels

(login for full post details)
  #1 (permalink)
Austin, Texas
 
 
Posts: 1 since Aug 2019
Thanks: 0 given, 0 received

Hello,
I need help finishing a script I pieced off of here. I want to plot the high, low and then 25%, 50% and 75%of the opening 30 minute range. The script I have pasted does this but then it goes to the next 30 minutes and plots the high, low etc. of that and so on and so on as the pic I have attached shows. I just want the first 30 minutes plotted and then for those levels to extend for the rest of the day. Any help is appreciated. The way I plan to use this is those levels tend to be important levels the rest of the day, especially the 50% mark. It is based off the Michael Shadkin rules.



plot hod = high(period = AggregationPeriod.THIRTY_MIN);
hod.SetDefaultColor(CreateColor(245, 127, 23));

plot lod = low(period = AggregationPeriod.THIRTY_MIN);
lod.SetDefaultColor(CreateColor(245, 127, 23));

def range = hod - lod;

plot hod764 = (range * 0.75) + lod;
hod764.SetDefaultColor(CreateColor(251, 192, 45));

plot lod236 = (range * 0.25) + lod;
lod236.SetDefaultColor(CreateColor(251, 192, 45));

plot mid50 = (range * 0.5) + lod;
mid50.SetDefaultColor(CreateColor(255, 235, 59));


hod.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
lod.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
hod764.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
lod236.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
mid50.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);

Reply With Quote

Can you help answer these questions
from other members on futures io?
Where is the link to download GomiRecorder?
NinjaTrader
is there an easy way to obtain by code the price variation percentual
MultiCharts
GBP/ARS Pair
Traders Hideout
Stacked Imbalances.
Sierra Chart
EQIX - Digital REITs - any experiences?
Stocks and ETFs
 
 
(login for full post details)
  #2 (permalink)
Seattle, WA/USA
 
Experience: Intermediate
Platform: TOS, TS
Trading: Forex, crude
 
Posts: 80 since Sep 2016
Thanks: 7 given, 27 received

The issue is that your aggregation period is simply looking at the 30 minute time buckets. You need to delineate which 30 minute period you are interested in. Check out this well commented example from reddit:
 
Code
input opentime = 0930;
input ORend = 1000;
input opacity = .7;
def na = Double.NaN;
#
# Check if the opening range time is now
#
def ORActive = if GetLastDay() == GetDay() and SecondsFromTime(opentime) >= 0 and SecondsFromTime(ORend) < 
0 then 1 else 0;
#
# Track the OR high and low
#
def ORHigh = if ORActive then high else na;
def ORLow = if ORActive then low else na;
#
# Plot the OR high and low
#
plot ORAH = if GetLastDay() != GetDay() or !ORActive then na else HighestAll(ORHigh);
plot ORAL = if GetLastDay() != GetDay() or !ORActive then na else LowestAll(ORLow);
plot ORH = if GetLastDay() != GetDay() or SecondsFromTime(ORend) < 0 then na else HighestAll(ORHigh);
plot ORL = if GetLastDay() != GetDay() or SecondsFromTime(ORend) < 0 then na else LowestAll(ORLow);
#
# Formatting
#
ORAH.SetStyle(Curve.SHORT_DASH);
ORAL.SetStyle(Curve.SHORT_DASH);
ORAH.SetDefaultColor(Color.GREEN);
ORAL.SetDefaultColor(Color.RED);
ORH.SetStyle(Curve.SHORT_DASH);
ORL.SetStyle(Curve.SHORT_DASH);
ORH.SetDefaultColor(Color.GREEN);
ORL.SetDefaultColor(Color.RED);
#
# Add Cloud creates the shading
#
AddCloud(ORH, ORL);
AddCloud(ORAL, ORAH);
#
# Alerts:
#
def alerttrigger = if (high >= ORH and low <= ORH) or (high >= ORL and low <= ORL) then 1 else 0; #replace the 1 with 
your definition
# BLOCK CODE BELOW
input alerttext = "OR Breakout!";
input UseAlerts = {false, default true};
input AlertType = {default "BAR", "ONCE", "TICK"};
def at = AlertType;
input AlertSound = {"Bell", "Chimes", default "Ding", "NoSound", "Ring"};
Alert(alerttrigger and UseAlerts, alerttext, if at == 1 then Alert.ONCE else if at == 2 then Alert.TICK else Alert.BAR, 
AlertSound);
modify that with your fibs, desired colors, and painting styles and voila!

Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators ThinkOrSwim > Help finishing a script plotting opening 30 min levels


September 10, 2019


Upcoming Webinars and Events
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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