NexusFi: Find Your Edge


Home Menu

 





Trader Dale Volume Profile Study for TOS


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one byront with 2 posts (4 thanks)
    2. looks_two Nube with 1 posts (0 thanks)
    3. looks_3 Kacun with 1 posts (0 thanks)
    4. looks_4 theelderwand with 1 posts (0 thanks)
    1. trending_up 8,702 views
    2. thumb_up 4 thanks given
    3. group 6 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Trader Dale Volume Profile Study for TOS

  #1 (permalink)
 theelderwand 
Redmond WA
 
Experience: Master
Platform: ThinkOrSwim
Trading: ES CL GC
Posts: 4 since Apr 2019
Thanks Given: 0
Thanks Received: 2

Has anybody been able to successfully replicate the Trader Dale's Volume Profile Study for flexible intervals within the chart in TOS ?

https://www.trader-dale.com/flexible-volume-profile-forex-indicator/

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Build trailing stop for micro index(s)
Psychology and Money Management
Futures True Range Report
The Elite Circle
Exit Strategy
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
byront
Brooklyn, NY
 
Posts: 6 since Apr 2019
Thanks Given: 3
Thanks Received: 6

Just bumping this up because I would love to see this too. Seems incredibly useful.

Reply With Quote
  #3 (permalink)
byront
Brooklyn, NY
 
Posts: 6 since Apr 2019
Thanks Given: 3
Thanks Received: 6


So I did some minor tweaking to the ToS VolumeProfile study to add 5, 15, and 30 min options. It's not as cool as Trader Dale's but it allows for more fine grained profiles to be set. Here's the code, which you'll have to create a new study and paste it into:


 
Code
# Paste this code into a new study

input pricePerRowHeightMode = {default TICKSIZE, AUTOMATIC, CUSTOM};
input customRowHeight = 1.0;
input timePerProfile = {CHART, MINUTE, FIVEMINUTE, QUARTERHOUR, default HALFHOUR, HOUR, DAY, WEEK, MONTH, "OPT EXP", BAR};
input multiplier = 1;
input onExpansion = no;
input profiles = 1000;
input showPointOfControl = yes;
input showValueArea = yes;
input valueAreaPercent = 70;
input opacity = 25;

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 FIVEMINUTE:
    period = floor(seconds / 300 + day_number * 24 * 12);
case QUARTERHOUR:
    period = floor(seconds / 900 + day_number * 24 * 4);
case HALFHOUR:
    period = floor(seconds / 1800 + day_number * 24 * 2);
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;
}

def count = CompoundValue(1, if period != period[1] then (count[1] + period - period[1]) % multiplier else count[1], 0);
def cond = count < count[1] + period - period[1];
def height;
switch (pricePerRowHeightMode) {
case AUTOMATIC:
    height = PricePerRow.AUTOMATIC;
case TICKSIZE:
    height = PricePerRow.TICKSIZE;
case CUSTOM:
    height = customRowHeight;
}

profile vol = volumeProfile("startNewProfile" = cond, "onExpansion" = onExpansion, "numberOfProfiles" = profiles, "pricePerRow" = height, "value area percent" = valueAreaPercent);
def con = compoundValue(1, onExpansion, no);
def pc = if IsNaN(vol.getPointOfControl()) and con then pc[1] else vol.getPointOfControl();
def hVA = if IsNaN(vol.getHighestValueArea()) and con then hVA[1] else vol.getHighestValueArea();
def lVA = if IsNaN(vol.getLowestValueArea()) and con then lVA[1] else vol.getLowestValueArea();

def hProfile = if IsNaN(vol.getHighest()) and con then hProfile[1] else vol.getHighest();
def lProfile = if IsNaN(vol.getLowest()) and con then lProfile[1] else vol.getLowest();
def plotsDomain = IsNaN(close) == onExpansion;

plot POC = if plotsDomain then pc else Double.NaN;
plot ProfileHigh = if plotsDomain then hProfile else Double.NaN;
plot ProfileLow = if plotsDomain then lProfile else Double.NaN;
plot VAHigh = if plotsDomain then hVA else Double.NaN;
plot VALow = if plotsDomain then lVA else Double.NaN;

DefineGlobalColor("Profile", GetColor(1));
DefineGlobalColor("Point Of Control", GetColor(5));
DefineGlobalColor("Value Area", GetColor(8));

vol.show(globalColor("Profile"), if showPointOfControl then globalColor("Point Of Control") else color.current, if showValueArea then globalColor("Value Area") else color.current, opacity);
POC.SetDefaultColor(globalColor("Point Of Control"));
POC.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VALow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
VAHigh.SetDefaultColor(globalColor("Value Area"));
VALow.SetDefaultColor(globalColor("Value Area"));
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileHigh.SetDefaultColor(GetColor(3));
ProfileLow.SetDefaultColor(GetColor(3));
ProfileHigh.hide();
ProfileLow.hide();

Reply With Quote
Thanked by:
  #4 (permalink)
 
Kacun's Avatar
 Kacun 
Vienna, VA / USA
 
Experience: Intermediate
Platform: Ninja, Think or Swim
Trading: 6E, 6A, ES, NG, CL, and Stock Options
Posts: 4 since Jan 2013
Thanks Given: 32
Thanks Received: 4

I called the support staff at TOS asking the same question: can I place and adjust the volume profile tool to any length of time on the horizontal axis as I see fit? unfortunately the answer is no.

I am interested in being able to place the volume profile tool on TOS to any particular area of interest regardless of its length in time (horizontal axis). That flexibility is really important because all areas of interest (i.e balance areas particularly) are not created equal.

I am considering migrating to Ninja just for this reason.

cucuye
Reply With Quote
  #5 (permalink)
Nube
Minneapolis Minnesota
 
Posts: 24 since Jul 2019
Thanks Given: 0
Thanks Received: 13

You can start a new profile on any bar(s) that you want. However, Thinkscript does not have access to the mouse so it's not possible to have the type of control control seen in the video

Reply With Quote
  #6 (permalink)
IanTai
Newark NJ USA
 
Posts: 1 since Jun 2020
Thanks Given: 0
Thanks Received: 0


Nube View Post
You can start a new profile on any bar(s) that you want. However, Thinkscript does not have access to the mouse so it's not possible to have the type of control control seen in the video

I played with the Ninjatrader profile drawing a bit. It works great. Tradovate has profile drawing tool, as well.

It doesn't sound quite right, that you can draw pretty much anything in TOS, but that you can't draw a volume profile.

It would be a wonderful addition to the TOS program. I find it tedious to reconfigure the volume profile indicator to start it on a specific bar.

One way to get closer to a flexible volume profile would be to add a parameter that allowed the user to set a start and end date. I have seen some anchored VWaps that allow the user to set the anchor date.

But, that is beyond my coding skills.

Reply With Quote




Last Updated on June 28, 2020


© 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