NexusFi: Find Your Edge


Home Menu

 





Previous Week Midpoint?


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,811 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Previous Week Midpoint?

  #1 (permalink)
fmsfx
Orlando Florida
 
Posts: 3 since Oct 2017
Thanks Given: 2
Thanks Received: 0

Does anyone have a script that will display with a line the midpoint of the previous and current Weeks High and low? Previous weeks midpoint display could be a dashed line and current weeks midpoint could be a solid line for example.....TIA


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
Trade idea based off three indicators.
Traders Hideout
What broker to use for trading palladium futures
Commodities
 
  #2 (permalink)
 
Cerberus's Avatar
 Cerberus 
Vancouver Canada
 
Experience: Intermediate
Platform: TOS, IB
Trading: es ym etf's
Posts: 35 since Feb 2011
Thanks Given: 24
Thanks Received: 26


fmsfx View Post
Does anyone have a script that will display with a line the midpoint of the previous and current Weeks High and low? Previous weeks midpoint display could be a dashed line and current weeks midpoint could be a solid line for example.....TIA


Try this for now - plots the week average - will take a closer look over w'end re hi/lo, etc:

dashed line u can do in input and options "Draw as:" and "Style:"

-------------------

plot Data = open;
def th = high(period = "week")[0];
def tl = low(period = "week")[0];
def pc = open(period = "week")[0];


def avgrange2 = (th - tl) / 2;

plot weekavg = (th + tl) / 2;
input bubbles = yes;
AddChartBubble(bubbles and !IsNaN(close[4]) and IsNaN(close[3]), weekavg[4], "weekMid", Color.VIOLET, yes);


---

Reply With Quote
Thanked by:
  #3 (permalink)
fmsfx
Orlando Florida
 
Posts: 3 since Oct 2017
Thanks Given: 2
Thanks Received: 0



Cerberus View Post
Try this for now - plots the week average - will take a closer look over w'end re hi/lo, etc:

dashed line u can do in input and options "Draw as:" and "Style:"

-------------------

plot Data = open;
def th = high(period = "week")[0];
def tl = low(period = "week")[0];
def pc = open(period = "week")[0];


def avgrange2 = (th - tl) / 2;

plot weekavg = (th + tl) / 2;
input bubbles = yes;
AddChartBubble(bubbles and !IsNaN(close[4]) and IsNaN(close[3]), weekavg[4], "weekMid", Color.VIOLET, yes);


---

OK perfect...thanks for the help and look forward to any added script.

Dave

Reply With Quote
  #4 (permalink)
 
Cerberus's Avatar
 Cerberus 
Vancouver Canada
 
Experience: Intermediate
Platform: TOS, IB
Trading: es ym etf's
Posts: 35 since Feb 2011
Thanks Given: 24
Thanks Received: 26


fmsfx View Post
OK perfect...thanks for the help and look forward to any added script.

Dave

I tinkered around with some code I had. Leave the the displace option on zero

You can pick a range of aggregation periods under inputs - also week of course )
Chartbubbles are Phi Plo for Period hi resp lo. If you use only week you can adjust the bubble with ie Wkhi Wklo.
Depends also how many lines you have on your charts. Bubbles help to keep confusion somewhat under control

Let me know if that works

----

plot Data = close;input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = 0;
input showOnlyLastPeriod = no;

plot DailyHigh;
plot DailyLow;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {
DailyHigh = Double.NaN;
DailyLow = Double.NaN;
} else {
DailyHigh = Highest(high(period = aggregationPeriod)[-displace], length);
DailyLow = Lowest(low(period = aggregationPeriod)[-displace], length);
}

DailyHigh.SetDefaultColor(GetColor(4));
DailyHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyLow.SetDefaultColor(GetColor(4));
DailyLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);


AddChartBubble( !IsNaN(close[4]) and IsNaN(close[3]), DailyHigh[4], "Phi", Color.LIGHT_GREEN, yes);
AddChartBubble(!IsNaN(close[4]) and IsNaN(close[3]), DailyLow[4], "Plo", Color.DARK_ORANGE, yes);

----------------


..

Reply With Quote
Thanked by:
  #5 (permalink)
fmsfx
Orlando Florida
 
Posts: 3 since Oct 2017
Thanks Given: 2
Thanks Received: 0


Cerberus View Post
I tinkered around with some code I had. Leave the the displace option on zero

You can pick a range of aggregation periods under inputs - also week of course )
Chartbubbles are Phi Plo for Period hi resp lo. If you use only week you can adjust the bubble with ie Wkhi Wklo.
Depends also how many lines you have on your charts. Bubbles help to keep confusion somewhat under control

Let me know if that works

----

plot Data = close;input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = 0;
input showOnlyLastPeriod = no;

plot DailyHigh;
plot DailyLow;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {
DailyHigh = Double.NaN;
DailyLow = Double.NaN;
} else {
DailyHigh = Highest(high(period = aggregationPeriod)[-displace], length);
DailyLow = Lowest(low(period = aggregationPeriod)[-displace], length);
}

DailyHigh.SetDefaultColor(GetColor(4));
DailyHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyLow.SetDefaultColor(GetColor(4));
DailyLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);


AddChartBubble( !IsNaN(close[4]) and IsNaN(close[3]), DailyHigh[4], "Phi", Color.LIGHT_GREEN, yes);
AddChartBubble(!IsNaN(close[4]) and IsNaN(close[3]), DailyLow[4], "Plo", Color.DARK_ORANGE, yes);

----------------


..


Thanks Again...will load it up. I would post a pic of my goal of this idea but I need a few more post to post pic via Gyazo

Reply With Quote




Last Updated on October 17, 2017


© 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