Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
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)
Is it possible to group the MonkeyBars chart to display a week?
Updated May 25, 2021
Top Posters
looks_one
Massive l
with 7 posts (12 thanks)
looks_two
Yakito
with 4 posts (0 thanks)
looks_3
Lady
with 3 posts (0 thanks)
looks_4
MNSTrading
with 1 posts (0 thanks)
trending_up
5,844 views
thumb_up
12 thanks given
group
6 followers
forum
14 posts
attach_file
0 attachments
Is it possible to group the MonkeyBars chart to display a week?
August 6th, 2013, 01:52 PM
Buenos Aires, Argentina
Posts: 47 since Jun 2013
Thanks Given: 39
Thanks Received: 4
Hello,
I been trying unsuccessfully to make a money bar chart grouped into weeks where each letter (or number in TOS ) represents 1 hour.
I can't seem to be able to group the chart in anything else besides days, months and years.
Any tip? Thanks!
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
August 6th, 2013, 09:03 PM
OR/USA
Legendary /NQ Trader
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106
Code
input pricePerRowHeightMode = {default TICKSIZE, AUTOMATIC, CUSTOM};
input customRowHeight = 1.0;
input aggregationPeriod = {"1 min", "2 min", "3 min", "4 min", "5 min", "10 min", "15 min", "20 min", default "1 hour", "30 min", "2 hours", "4 hours", "Day", "2 Days", "3 Days", "4 Days", "Week", "Month"};
input timePerProfile = {default WEEK, MINUTE, HOUR, DAY, CHART, MONTH, "OPT EXP", BAR, YEAR};
input multiplier = 1;
input onExpansion = no;
input profiles = 10;
input showMonkeyBar = no;
input showThePlayground = no;
input thePlaygroundPercent = 95;
input opacity = 100;
input emphasizeFirstDigit = no;
input markOpenPrice = yes;
input markClosePrice = yes;
input volumeShowStyle = MonkeyVolumeShowStyle.NONE;
input showVolumeVA = no;
input showVolumePoc = no;
input theVolumePercent = 95;
input showInitialBalance = yes;
input initialBalanceRange = 3;
def period;
def yyyymmdd = getYyyyMmDd();
def seconds = secondsFromTime(0);
def month = getYear() * 12 + getMonth();
def day_number = daysFromDate(first(yyyymmdd)) + getDayOfWeek(first(yyyymmdd));
def dom = getDayOfMonth(yyyymmdd);
def dow = getDayOfWeek(yyyymmdd - dom + 1);
def expthismonth = (if dow > 5 then 27 else 20) - dow;
def exp_opt = month + (dom > expthismonth);
def periodMin = Floor(seconds / 60 + day_number * 24 * 60);
def periodHour = Floor(seconds / 3600 + day_number * 24);
def periodDay = countTradingDays(Min(first(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
def periodWeek = Floor(day_number / 7);
def periodMonth = month - first(month);
switch (timePerProfile) {
case CHART:
period = 0;
case MINUTE:
period = periodMin;
case HOUR:
period = periodHour;
case DAY:
period = periodDay;
case WEEK:
period = periodWeek;
case MONTH:
period = periodMonth;
case "OPT EXP":
period = exp_opt - first(exp_opt);
case BAR:
period = barNumber() - 1;
case YEAR:
period = getYear() - first(getYear());
}
def count = compoundvalue(1, if period != period[1] then (getValue(count, 1) + period - period[1]) % multiplier else getValue(count, 1), 0);
def cond = compoundvalue(1, count < count[1] + period - period[1], yes);
def height;
switch (pricePerRowHeightMode) {
case AUTOMATIC:
height = PricePerRow.AUTOMATIC;
case TICKSIZE:
height = PricePerRow.TICKSIZE;
case CUSTOM:
height = customRowHeight;
}
def timeInterval;
def aggMultiplier;
switch (aggregationPeriod) {
case "1 min":
timeInterval = periodMin;
aggMultiplier = 1;
case "2 min":
timeInterval = periodMin;
aggMultiplier = 2;
case "3 min":
timeInterval = periodMin;
aggMultiplier = 3;
case "4 min":
timeInterval = periodMin;
aggMultiplier = 4;
case "5 min":
timeInterval = periodMin;
aggMultiplier = 5;
case "10 min":
timeInterval = periodMin;
aggMultiplier = 10;
case "15 min":
timeInterval = periodMin;
aggMultiplier = 15;
case "20 min":
timeInterval = periodMin;
aggMultiplier = 20;
case "30 min":
timeInterval = periodMin;
aggMultiplier = 30;
case "1 hour":
timeInterval = periodHour;
aggMultiplier = 1;
case "2 hours":
timeInterval = periodHour;
aggMultiplier = 2;
case "4 hours":
timeInterval = periodHour;
aggMultiplier = 4;
case "Day":
timeInterval = periodDay;
aggMultiplier = 1;
case "2 Days":
timeInterval = periodDay;
aggMultiplier = 2;
case "3 Days":
timeInterval = periodDay;
aggMultiplier = 3;
case "4 Days":
timeInterval = periodDay;
aggMultiplier = 4;
case "Week":
timeInterval = periodWeek;
aggMultiplier = 1;
case "Month":
timeInterval = periodMonth;
aggMultiplier = 1;
}
def agg_count = compoundvalue(1, if timeInterval != timeInterval[1] then (getValue(agg_count, 1) + timeInterval - timeInterval[1]) % aggMultiplier else getValue(agg_count, 1), 0);
def agg_cond = compoundvalue(1, agg_count < agg_count[1] + timeInterval - timeInterval[1], yes);
def digit = compoundValue(1, if cond then 1 else agg_cond + getValue(digit, 1), 1);
profile monkey = monkeyBars(digit, "startNewProfile" = cond, "onExpansion" = onExpansion,
"numberOfProfiles" = profiles, "pricePerRow" = height, "the playground percent" = thePlaygroundPercent,
"emphasize first digit" = emphasizeFirstDigit, "volumeProfileShowStyle" = volumeShowStyle, "volumePercentVA" = theVolumePercent,
"show initial balance" = showInitialBalance, "initial balance range" = initialBalanceRange);
def con = compoundValue(1, onExpansion, no);
def mbar = compoundvalue(1, if IsNaN(monkey.getPointOfControl()) and con then getValue(mbar, 1) else monkey.getPointOfControl(), monkey.getPointOfControl());
def hPG = compoundvalue(1, if IsNaN(monkey.getHighestValueArea()) and con then getValue(hPG, 1) else monkey.getHighestValueArea(), monkey.getHighestValueArea());
def lPG = compoundvalue(1, if IsNaN(monkey.getLowestValueArea()) and con then getValue(lPG, 1) else monkey.getLowestValueArea(), monkey.getLowestValueArea());
def hProfile = compoundvalue(1, if IsNaN(monkey.getHighest()) and con then getValue(hProfile, 1) else monkey.getHighest(), monkey.getHighest());
def lProfile = compoundvalue(1, if IsNaN(monkey.getLowest()) and con then getValue(lProfile, 1) else monkey.getLowest(), monkey.getLowest());
def plotsDomain = IsNaN(close) == onExpansion;
plot MB = if plotsDomain then mbar else Double.NaN;
plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
plot PGHigh = if plotsDomain then hPG else Double.NaN;
plot PGLow = if plotsDomain then lPG else Double.NaN;
DefineGlobalColor("Monkey Bar", GetColor(4));
DefineGlobalColor("The Playground", GetColor(3));
DefineGlobalColor("Open Price", GetColor(1));
DefineGlobalColor("Close Price", GetColor(1));
DefineGlobalColor("Volume", GetColor(8));
DefineGlobalColor("Volume Value Area", GetColor(2));
DefineGlobalColor("Volume Point of Control", GetColor(3));
DefineGlobalColor("Initial Balance", GetColor(7));
monkey.show(color.red, if showMonkeyBar then globalColor("Monkey Bar") else color.current,
if showThePlayground then globalColor("The Playground") else color.current,
opacity, if markOpenPrice then globalColor("Open Price") else color.current,
if markClosePrice then globalColor("Close Price") else color.current,
if showInitialBalance then globalColor("Initial Balance") else color.current,
globalColor("Volume"),
if showVolumeVA then globalColor("Volume Value Area") else color.current,
if showVolumePOC then globalColor("Volume Point of Control") else color.current);
MB.SetDefaultColor(globalColor("Monkey Bar"));
MB.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PGHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PGLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PGHigh.SetDefaultColor(globalColor("The Playground"));
PGLow.SetDefaultColor(globalColor("The Playground"));
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));
ProfileHigh.hide();
ProfileLow.hide();
You can change "Show Volume Style" in the input panel to "ALL" from "NONE" if you want the volume profile shown with the TPO .
Also, the aggregation period looks better on 5 minute rather than 1hr.
August 6th, 2013, 09:14 PM
OR/USA
Legendary /NQ Trader
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106
August 7th, 2013, 02:50 PM
Buenos Aires, Argentina
Posts: 47 since Jun 2013
Thanks Given: 39
Thanks Received: 4
Thats exactly what I was looking for. Thanks a lot for your help! I don't know why I was not able to find it!
August 7th, 2013, 02:54 PM
Buenos Aires, Argentina
Posts: 47 since Jun 2013
Thanks Given: 39
Thanks Received: 4
by the way, you developed that code or it is publicly available somewhere I am missing? Thanks again for your help
August 7th, 2013, 03:44 PM
OR/USA
Legendary /NQ Trader
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106
It's part of the monkey bar code tos already has. I just changed the parameters inside the code so you didn't have to change much.
By the way, the va high and va low (playground) is at the 2nd standard deviation which is a preference of mine. The 1st one doesn't mean
much to me but it's the default on almost every profile you'll see. You can change it back by changing the setting to 70 from 95.
August 7th, 2013, 07:10 PM
Buenos Aires, Argentina
Posts: 47 since Jun 2013
Thanks Given: 39
Thanks Received: 4
Thanks again. I saw the difference in the standard deviation , I will leave it at 95 and make some tests, maybe it helps my trading.
I never used the profile in anything besides intraday so I am not sure if the logic still works with different timeframes. I imagine it would be more difficult to understand who is who on a weekly or monthly chart.
August 7th, 2013, 10:21 PM
OR/USA
Legendary /NQ Trader
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106
I predominately use a 6hr chart with 1 and 3 month profiles and hold anywhere
from 2 days to 2 months.
May 24th, 2021, 01:20 PM
Medellín, CO
Experience: Intermediate
Platform: NinjaTrader
Trading: Playing with eMinis, coming from Options
Posts: 83 since Jun 2015
Thanks Given: 14
Thanks Received: 43
Massive l
Let me ask you a stupid question. My 4k resolution screen is not really showing the vertical lines. Would you know how to change the weight/width of those to be more visible?
May 24th, 2021, 02:53 PM
OR/USA
Legendary /NQ Trader
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106
Lady
Let me ask you a stupid question. My 4k resolution screen is not really showing the vertical lines. Would you know how to change the weight/width of those to be more visible?
Which vertical lines are you referring to?
Last Updated on May 25, 2021