accumulated up and down volume on renko chart - futures io
futures io



accumulated up and down volume on renko chart


Discussion in TradeStation

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




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

accumulated up and down volume on renko chart

(login for full post details)
  #1 (permalink)
PippiLong
Dallas, TX
 
 
Posts: 7 since Jul 2012
Thanks: 1 given, 0 received

I am new to Easy Language (and this site). I am trying to print a text object at the top of an upwave on a renko chart in Tradestation that is the total volume of all of the up bars in that wave. Also want to print a total at the bottom of a down wave. I can calculate the number, however I can't figure out how to print as a text object the right number above the right bar because the only difference I see in the top most bar from the other up bars is that the next bar closes lower than the top bar but I can't reference a bar in the future.

Ultimately I would also like to print the total minutes in the up and down wave but got stopped at the above problem. Any help would be greatly appreciated.

Reply With Quote

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(302 thanks from 30 posts)
looks_twoSalao's Journalby Salao
(80 thanks from 13 posts)
looks_3Deetee’s DAX Trading Journal (time based)by Deetee
(50 thanks from 20 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(38 thanks from 16 posts)
looks_5Maybe a little bit different journalby Malykubo
(17 thanks from 18 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
The Crude Dude Oil Trading System
122 thanks
Big Mike in Ecuador
60 thanks
Help improve the FIO community
38 thanks
Next New Poll Ideas/Suggestions
20 thanks
futures io site changelog and issues/problem reporting
16 thanks
 
(login for full post details)
  #2 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
 
Posts: 882 since Mar 2011
Thanks: 124 given, 701 received


PippiLong View Post
I am new to Easy Language (and this site). I am trying to print a text object at the top of an upwave on a renko chart in Tradestation that is the total volume of all of the up bars in that wave. Also want to print a total at the bottom of a down wave. I can calculate the number, however I can't figure out how to print as a text object the right number above the right bar because the only difference I see in the top most bar from the other up bars is that the next bar closes lower than the top bar but I can't reference a bar in the future.

Ultimately I would also like to print the total minutes in the up and down wave but got stopped at the above problem. Any help would be greatly appreciated.

I can't help you with the text object, but in a simple indicator.....

variables: direction(0), wavevolumeup(0), wavevolumedn(0);

if close > close[1] then direction = 1;
if close < close[1] then direction = -1;

if direction = 1 then begin
wavevolumedn = 0;
wavevolumeup = upticks;
wavevolumeup = wavevolumeup + wavevolumeup[1];
end;

if direction = -1 then begin
wavevolumeup = 0;
wavevolumedn = downticks;
wavevolumedn = wavevolumedn + wavevolumedn[1];
end;

this will give you the total volume for each up string and each down string and print along the way for each bar.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
The following user says Thank You to RM99 for this post:
 
(login for full post details)
  #3 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
 
Posts: 882 since Mar 2011
Thanks: 124 given, 701 received


As far as keeping track of the time,

You can use a similar approach, but you'll have to convert the timestamp to a string. (there's several methods for this, just reference the help index for the reserved functions).

You'll have to reference the previous close from a new change bar..

if direction <> direction[1] then starttime = time[1];
totaltime = time - starttime;

this is of course, after converting the time to a string (for runs that cross over midnight and over weekends, etc).

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
 
(login for full post details)
  #4 (permalink)
PippiLong
Dallas, TX
 
 
Posts: 7 since Jul 2012
Thanks: 1 given, 0 received

Thank you very much for the reply. I appreciate it very much. I think I got to the same place. However where I am stuck is how to only print the total at the last high or low bar of each wave and not at each bar. The following code prints it at each bar which I think is similar to yours.






inputs:
UpColor(darkGreen),
DnColor(darkred),
ScaleVolBy(100);

vars:
up(0),
dn(0),
vol(0),
UpWavevolume (0),
DnWavevolume (0);



vol=upticks+downticks;

if c>o then begin
if dn>0 then up=vol else up=up+vol;
dn=0;
end;

if c<o then begin
if up>0 then dn=vol else dn=dn+vol;
up=0;
end;

UpWavevolume= up * Reciprocal(ScaleVolBy);
DnWavevolume= dn * Reciprocal(Scalevolby);

IF up>0 then begin
Value1 = Text_New(Date, Time, High + Range * 1.5, Numtostr(upwavevolume,0));
Text_SetColor(Value1, UpColor);
Text_setstyle(Value1, 2, 1);

end;

IF dn>0 then begin
Value1 = Text_New(Date, Time, Low - Range * 1.5, Numtostr(DnWavevolume,0));
Text_SetColor(Value1, DnColor);
Text_setstyle(Value1, 2, 0) ;

end;

Reply With Quote
 
(login for full post details)
  #5 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
 
Posts: 882 since Mar 2011
Thanks: 124 given, 701 received


PippiLong View Post
Thank you very much for the reply. I appreciate it very much. I think I got to the same place. However where I am stuck is how to only print the total at the last high or low bar of each wave and not at each bar. The following code prints it at each bar which I think is similar to yours.






inputs:
UpColor(darkGreen),
DnColor(darkred),
ScaleVolBy(100);

vars:
up(0),
dn(0),
vol(0),
UpWavevolume (0),
DnWavevolume (0);



vol=upticks+downticks;

if c>o then begin
if dn>0 then up=vol else up=up+vol;
dn=0;
end;

if c<o then begin
if up>0 then dn=vol else dn=dn+vol;
up=0;
end;

UpWavevolume= up * Reciprocal(ScaleVolBy);
DnWavevolume= dn * Reciprocal(Scalevolby);

IF up>0 then begin
Value1 = Text_New(Date, Time, High + Range * 1.5, Numtostr(upwavevolume,0));
Text_SetColor(Value1, UpColor);
Text_setstyle(Value1, 2, 1);

end;

IF dn>0 then begin
Value1 = Text_New(Date, Time, Low - Range * 1.5, Numtostr(DnWavevolume,0));
Text_SetColor(Value1, DnColor);
Text_setstyle(Value1, 2, 0) ;

end;

hmmm, the only way you'll accomplish this is to print the total for the previous wave at the beginning of the next wave. Because you're using Renko, there's no need to separate upticks and downticks, the chart will only reference upticks for up bars and downticks for down bars, the values for the opposite volume will be zero, but you'll have to split the up and down waves because that's the only way to get the individual totals without losing a bar upon the rest.

try this....

variables: direction(0), wavetotal(0), waveup(0), wavedn(0);

if close > open then direction = 1 else direction = -1;

if direction = 1 then begin
wavedn = 0;
waveup = upticks;
waveup = waveup + waveup[1];
end;

if direction = -1 then begin
waveup = 0;
wavedn = downticks;
wavedn = wavedn + wavedn[1];
end;

wavetotal = 0;
if direction > direction[1] then wavetotal = wavedn[1];
if direction < direction[1] then wavetotal = waveup[1];

plot1(wavetotal);


This should print the wavetotal only upon a change in direction, but it will be the volume for the previous wave.

If you're printing, I'd imagine you don't want the extra/noisy values of all the running volume values in the middle of the string.

This is the only option (to print upon a new string for the previous string's value) simply because the chart has no way of knowing that it's the end of a wave until the bar is closed/a new bar in the opposite direction has already begun. In essence, there's no way for any algorythm to know that the current bar is the end of the string (until it's already passed).

So your two choices are to print the running total on all bars in a string (which I'm sure is a bunch of extra data you're not interested in, making the files large) OR to print only once per string, but a bar delayed (at the beginning of a new string) which references the previous strings total.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
The following 2 users say Thank You to RM99 for this post:
 
(login for full post details)
  #6 (permalink)
PippiLong
Dallas, TX
 
 
Posts: 7 since Jul 2012
Thanks: 1 given, 0 received

Yay! It works. I had tried printing the total for the previous bar over the next bar but I kept getting the wrong volume on top of the next bar. So for some reason referencing the prior bars accum vol worked this time but I would not have been able to do it without your example. So THANKS.

For some reason your code was giving me a different accumulated volume but I honestly can not tell why so I just used my previous code and changed the condition for the printing of the up direction to

If C < Open and upwavevolume[1] <> 0 (without the second condition the other bars printed 0)

and added the [1] to the numtostr(upwavevolume[1] so the prior bar's value would print.

Thanks

Reply With Quote
 
(login for full post details)
  #7 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
 
Posts: 882 since Mar 2011
Thanks: 124 given, 701 received

Glad to help....

I recommend artificially creating the renko bars instead of using the standard renko chart.

If you us Kase bars and artificially replicate the renko on top, not only will you be able to see the true high/low (and all the movement inside the bar) but you'll also be able to see the other volume component.

Additionally, with renko, you're not going to see gaps...so if there's a gap that's larger than your renko instrument, it's simply going to create a new bar(s) in the gap, which can be troublesome for a number of reasons.

I have the artifical renko paintbar and indicator if you're interested.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
 
(login for full post details)
  #8 (permalink)
PippiLong
Dallas, TX
 
 
Posts: 7 since Jul 2012
Thanks: 1 given, 0 received

Yes please send me the indicator. think that would be helpful to be able to see the high and low. I would like to take a look. Thank you very much.

Reply With Quote
 
(login for full post details)
  #9 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
 
Posts: 882 since Mar 2011
Thanks: 124 given, 701 received

Input:
FirstBrickHi(9523), // to syncronize with a base renko chart
Bricksize(10),
upcolor (rgb(185,255,185)), // light green
dwcolor (rgb(255,185,185)) ; // light red
Vars:
hiline(0),
loline(0),
direction(0);


// FIRST BRICK at the first bar of graph

If currentbar = 1 then
begin
If high > open then
begin
hiline= FirstBrickHi + bricksize ;
loline= hiline - bricksize ;
direction = 1;
end;
If low < open then
begin
loline= FirstBrickHi - bricksize;
hiline= loline + bricksize;
direction = -1;
end;
end;

// ALL OTHER BRICKS

If low <= loline - bricksize then
begin
direction = -1;
hiline= loline;
loline = loline - bricksize;
end;

If high >= hiline + bricksize then
begin
direction = 1;
loline = hiline;
hiline = loline + bricksize;
end;

// PLOTTING

If direction = 1 then Plotpaintbar(hiline,loline,"renko",upcolor) else
Plotpaintbar(hiline,loline,"renko",dwcolor) ;

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
 
(login for full post details)
  #10 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
 
Posts: 882 since Mar 2011
Thanks: 124 given, 701 received


Paste into a paintbar.

Open up the Renko chart you're attempting to replicate.

Now open a Kase chart with a smaller increment (preferably no more than half the desired Renko increment).

Insert paintbar. Input the high of the first bar on the real renko chart into the paintbar settings (ensure that the start dates for each chart match).

You can mess around with the R/B/G colors to your liking, I usually make the bricks fully red and fully green and then make my kase bars yellow, to contrast.

You can also take the body of the code minus the plot and use it to craft indicator values.

This will allow you to see true highs/lows, see intrabar movement and also see gaps. It will also allow you to execute intrabar (with respect to the renko brick) although it will be at the end of a Kase bar...so the smaller the Kase bars, the more closely you can approximate intrabarordergeneration. (although it does require a lot of processing power).

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > accumulated up and down volume on renko chart


Last Updated on July 23, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April

An Introduction to CME Group Micro Bitcoin Futures w/David Lerman

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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