Programming "Year" into the Volume Profile - ThinkOrSwim Programming | futures io social day trading
futures io futures trading


Programming "Year" into the Volume Profile
Updated: Views / Replies:1,010 / 6
Created: by Massive l Attachments:1

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Programming "Year" into the Volume Profile

  #1 (permalink)
Elite Member
Portland, OR
 
Futures Experience: None
Platform: tos
Favorite Futures: NQ, SB, 6J, CL, GC
 
Massive l's Avatar
 
Posts: 1,458 since Mar 2011
Thanks: 922 given, 1,821 received

Programming "Year" into the Volume Profile

I want to add the option to have a yearly profile. I don't want to use Month and then 12 as the multiplier.

Here's the code. Any help would be greatly appreciated. Thank you!

input pricePerRowHeightMode = {default TICKSIZE, AUTOMATIC, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {default DAY, MINUTE, HOUR, WEEK, CHART, MONTH, "OPT EXP", BAR};
input multiplier = 1;
input onExpansion = NO;
input profiles = 2;
input showPointOfControl = NO;
input showValueArea = NO;
input valueAreaPercent = 70;
input opacity = 50;

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);
switch (timePerProfile) {
case CHART:
period = 0;
case MINUTE:
period = Floor(seconds / 60 + day_number * 24 * 60);
case HOUR:
period = Floor(seconds / 3600 + day_number * 24);
case DAY:
period = countTradingDays(Min(first(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
period = Floor(day_number / 7);
case MONTH:
period = Floor(month - first(month));
case "OPT EXP":
period = exp_opt - first(exp_opt);
case BAR:
period = barNumber() - 1;
}

Psychology > Strategy ≥ Money
Reply With Quote
 
  #2 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received

I think these 3 additions should do the trick:

input timePerProfile = {default DAY, MINUTE, HOUR, WEEK, CHART, MONTH, "OPT EXP", BAR, YEAR};
def year = getYear();
case YEAR:
period = Floor(year - first(year));


and all toguether now:

input pricePerRowHeightMode = {default TICKSIZE, AUTOMATIC, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {default DAY, MINUTE, HOUR, WEEK, CHART, MONTH, "OPT EXP", BAR, YEAR};
input multiplier = 1;
input onExpansion = NO;
input profiles = 2;
input showPointOfControl = NO;
input showValueArea = NO;
input valueAreaPercent = 70;
input opacity = 50;

def period;
def yyyymmdd = getYyyyMmDd();
def seconds = secondsFromTime(0);
def month = getYear() * 12 + getMonth();
def year = getYear()
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);
switch (timePerProfile) {
case CHART:
period = 0;
case MINUTE:
period = Floor(seconds / 60 + day_number * 24 * 60);
case HOUR:
period = Floor(seconds / 3600 + day_number * 24);
case DAY:
period = countTradingDays(Min(first(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
case WEEK:
period = Floor(day_number / 7);
case MONTH:
period = Floor(month - first(month));
case "OPT EXP":
period = exp_opt - first(exp_opt);
case BAR:
period = barNumber() - 1;
case YEAR:
period = Floor(year - first(year));
}


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Last edited by rmejia; July 28th, 2012 at 10:48 AM.
Reply With Quote
The following user says Thank You to rmejia for this post:
 
  #3 (permalink)
Elite Member
Portland, OR
 
Futures Experience: None
Platform: tos
Favorite Futures: NQ, SB, 6J, CL, GC
 
Massive l's Avatar
 
Posts: 1,458 since Mar 2011
Thanks: 922 given, 1,821 received


rmejia! ya da man. Thank you so much.

Psychology > Strategy ≥ Money
Reply With Quote
 
  #4 (permalink)
Elite Member
Portland, OR
 
Futures Experience: None
Platform: tos
Favorite Futures: NQ, SB, 6J, CL, GC
 
Massive l's Avatar
 
Posts: 1,458 since Mar 2011
Thanks: 922 given, 1,821 received

If you are ever in Oregon, I'll show you some mind blowing shit. Let me know!

Psychology > Strategy ≥ Money
Reply With Quote
 
  #5 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received

lol, Oregon would be one heck of a trip, it's pretty far away from here. I considered moving to Portland after hearing the dream of the 90's was still alive there

Reply With Quote
 
  #6 (permalink)
Elite Member
Portland, OR
 
Futures Experience: None
Platform: tos
Favorite Futures: NQ, SB, 6J, CL, GC
 
Massive l's Avatar
 
Posts: 1,458 since Mar 2011
Thanks: 922 given, 1,821 received

It doesn't seem to be working on my end

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Psychology > Strategy ≥ Money
Reply With Quote
 
  #7 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received

I think you are missing the ";" at the end of the first line:

def year = getYear();

Reply With Quote
The following user says Thank You to rmejia for this post:

Reply



futures io > > > > > Programming "Year" into the Volume Profile

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Webinar: Sierra Chart Ladder, TPO, Volume Profile and "Homework" Big Mike Sierra Chart 16 September 23rd, 2014 04:48 PM
Fukushima: "China Syndrome Is Inevitable" ... "Huge Steam Explosions", or "Nuclear Bo Quick Summary News and Current Events 0 November 22nd, 2011 02:50 AM
How to change "Stop Loss" and "Take Profit" in "shElderImpulse" Strategy javed759 NinjaTrader 1 November 1st, 2011 11:44 PM
"mid", "buy", "sell" volumes lokgotkent Traders Hideout 6 September 30th, 2011 02:24 PM
RJay's "Trader Volume" and "Trader Tick" Indicator Suites RJay The Elite Circle 20 December 20th, 2010 06:01 PM


All times are GMT -4. The time now is 02:59 PM.

Copyright © 2017 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
Page generated 2017-12-13 in 0.10 seconds with 20 queries on phoenix via your IP 54.163.209.109