Brooks Price Action Forum Index Brooks Price Action
          
Home
Forums
Blog
Books
Trading Room
Trading Course
Check your PM
Register
Log in
          

Calendar 
         
Al's New
Trading Books!
more info here

.
Image 1193

.
Image 1194

.
Image 1195

Board Navigation
Go to the homepageHome
Index of the forum.Forum
Technical Analysis for the Serious TraderBooks
Al Brooks Live Trading RoomTrading Room
Brooks Price Action Trading CourseTrading Course
Twitter Feed
BrooksPriceAction YouTube ChannelYouTube Channel
Check articles uploaded to the websiteTrading Articles
Trading FAQTrading FAQ
Chat with other traders... not AlLive Text Chat
Display the acronyms being used by the forumAbbreviations
Help us fund loans to third-world countriesKiva Project

Check events posted in the forumCalendar
Links CategoriesLinks
News in RSS formatRSS Feed
Frequently Asked Questions.Board FAQ
Rules & DisclaimerRules&Disclaimer
Members of our staffStaff
Contact information for Al BrooksContact Us

Manage your own cookiesMy Cookies
Tell your friends about this great site.Tell A Friend
Articles
TOS bar counting help!
 
View previous topic View printer-friendly version Search Display number of posts for each poster in this topic Export topic thread to a text file View next topic
Author Message
Sozo7
512 Points

USA US Florida
PostYou have posted in this forum: Fri Jun 04, 2010 9:43 am   Post subject:  TOS bar counting help! Back to top 

Any TOS platform users that have a bar counting method available?

TOS tech does not know how to modify or add this feature...anybody?...THX

Download Post   
amazinday
21731 Points

USA US Texas
PostYou have posted in this forum: Fri Jun 04, 2010 5:47 pm   Post subject:   Back to top 

You'll probably have to modify the Tradestation code to use the language for TOS, which should be similar enough.

You might ask here for help:
http://www.thinkscripter.com/forum/

Download Post   
CaptainKirk
4711 Points

USA US Florida
PostYou have posted in this forum: Sun Jun 06, 2010 8:24 pm   Post subject:  Re: TOS bar counting help! Back to top 

If you can be more clear about what you want, I can probably help. I have written about 30 TOS studies.

There exists a function BarNumber() whch tells you the current bar number...
But I am a bit lost as to the importance of counting bars from an arbitrary bar standpoint.

Also, beware, that if you PAD the right side of a TOS chart with 5 bars, they will be numbered the highest
bar numbers, DESPITE a lack of data for them. But you can plot in that area if you wish.

Kirk Out!

Download Post   
CaptainKirk
4711 Points

USA US Florida
PostYou have posted in this forum: Tue Jun 22, 2010 6:01 am   Post subject:   Back to top 

Here is a Great Script to do this. Enjoy.

input showOnlyToday = YES;
input percent_above = 0.2;
input show_bars_divisable_by = 2;
input location = {default above, below};
input show_range_bubbles = NO;
input show_odd_bars_above = NO;
input maxbarnum = 81;
input Risk_Ticks_Add = 2;

def ticks_below = if TickSize()== 0.25 then 6 Else 10; #points_below/ticksize();
#def ticks_below = 5;

def Delta = Risk_Ticks_Add*ticksize();
# if TickSize()== 0.25 then Risk_ticks_Add else

def yyyyMmDd = getYyyyMmDd();
def session_duration_bars = (regularTradingEnd(yyyyMmDd) - regularTradingStart(yyyyMmDd)) / getAggregationPeriod();
# the above is useless because we cant use it!

#def T = lowest(low[ - session_duration_bars], session_duration_bars);

def lookback = if !IsNan(low[-81]) Then lowest(low[-81],81) Else
if !IsNan(low[-80]) Then lowest(low[-80],80) Else
if !IsNan(low[-26]) Then lowest(low[-26],26) Else
lowest(low[-79],79);

def percent;
def price;
def direction;

switch(location){
case above:
direction = yes;
price = high;
percent = 1 + percent_above/100;


case below:
direction = no;
price = low;
percent = 1 - percent_above/100;
}


def day = getDay();
def lastDay = getLastDay();
def isToday = day == lastday;
def firstBar = if (day[1] != day, day - 1, 0);
def shouldPlot = if(showOnlyToday and isToday, 1, if(!showOnlyToday, 1, 0));


rec count = if shouldPlot then if firstbar then 1 else count[1]+1 else 0;
rec lowval = if firstbar then lookback else lowval[1];
## lowest(low[-79],80)
#plot llow = lowval;
def barDivByTwo = count/show_bars_divisable_by == round(count/show_bars_divisable_by, 0);
def barDivByFour = count/(2*show_bars_divisable_by) == round(count/(2*show_bars_divisable_by), 0);

def blankBar = isNaN(close[-1]);

addchartbubble(barDivByTwo and !blankbar and shouldPlot and (count<maxbarnum),lowval,
concat(count, ""),
#concat(tickSize(), ""),
color.blue, direction);

addchartbubble(Show_Range_Bubbles and barDivByTwo and !blankbar and shouldPlot and (count<maxbarnum),lowval-(ticks_below*tickSize()), concat("", ((High-Low)+Delta)/TickSize()), color.red, direction);

##addchartbubble(Show_Range_Bubbles and barDivByTwo and barDivByFour and !blankbar and shouldPlot and (count<maxbarnum),lowval-(2*ticks_below*tickValue()), concat("", ((High-Low)+Delta)/TickSize()), color.red, direction);

Download Post   
Sozo7
512 Points

USA US Florida
PostYou have posted in this forum: Tue Jun 22, 2010 12:17 pm   Post subject:  Re: TOS bar counting help! Back to top 

can you post a pic of what this looks like, also are there any other TOS users that had success with this script?
I have been unable to get it to function.
Thanks

Download Post   
CaptainKirk
4711 Points

USA US Florida
PostYou have posted in this forum: Tue Jun 22, 2010 12:33 pm   Post subject:   Back to top 

This is a NEWER version of the code from the guys at TOS. It works great according to 2-3 people. You should be able to install it and use it as is. TURN OFF extended market hours to be safe. 5 Minute chart only.

I cannot add files to this post or forum...

Download Post   
CaptainKirk
4711 Points

USA US Florida
PostYou have posted in this forum: Tue Jun 22, 2010 12:34 pm   Post subject:   Back to top 

Please see if you get errors because of the QUOTES being inverted. If the script compiles, you should be fine.

PM me, I will setup a meeting using GoToMeeting after the market and set you up.

Kirk Out!
PS: this way I will know the problem and fix it for others in advance.

Download Post   
GoodSeed
64 Points

USA US Georgia
PostYou have posted in this forum: Tue Jun 22, 2010 6:47 pm   Post subject:   Back to top 

I am tos user... copied it in to new study and it worked without adjustment. Better to use for open session only.

Download Post   
CaptainKirk
4711 Points

USA US Florida
PostYou have posted in this forum: Tue Jun 22, 2010 6:53 pm   Post subject:   Back to top 

Yes, it is designed to work for the END OF DAY to be honest. It is very difficult to calculate the lowest bar of the day when the number of bars to look forward (not back) is unknown. there is a HACK I have figured out, but it only works if you OVERLAY the volume on the price chart (you basically assign Weak_Volume_Depency, and plot it at POSITION: Volume/Volume (1 by any other name), and change the bubble to be an TOP bubble. but it is a pain to do this.

I don't care about bar numbers DURING the open session. I care about them after the day is closed.

THANKS for confirming that everything worked. Love to know if there are a lot of other TOS users out there...

Download Post   
Sozo7
512 Points

USA US Florida
PostYou have posted in this forum: Thu Jun 24, 2010 5:44 am   Post subject:  Re: TOS bar counting help! Back to top 

Capt Kirk
Thanks for making the bar counter available on the TOS platform.
You did a nice job!

Download Post   
chulaihuey
266 Points

USA US North Carolina
PostYou have posted in this forum: Fri Feb 04, 2011 12:48 pm   Post subject:  Re: TOS bar counting help! Back to top 

I am also using thinkorswim (at least for now). Dropped your code in and it works fine, just had to disable extended session as you stated. Thanks, good work!

Download Post   
boilingsnail
6779 Points

France
PostYou have posted in this forum: Fri Jun 17, 2011 8:45 am   Post subject:   Back to top 

bar counting is real easy in thinkdesktop, although it took me a while to find this simple solution. It's for a 5min chart as 5*60=300.


# plot bar number using seconds since open at 0930 EST
plot barNum = 1 + (secondsFromTime(0930)/300);
barNum.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);

Download Post   
Display posts from previous:      


 Jump to:   



  View previous topic View printer-friendly version Search Display number of posts for each poster in this topic Export topic thread to a text file View next topic

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
MyCookies Manager  : 
Al Brooks on Google+
 phpBB Security ©  Has Blocked 97 Exploit Attempts.
 @ 2007 The Integra Team
 @ 2007 phpBB Group
[ Style ::Ported by:: Pantera ~ :: BBLite : All times are GMT - 8 Hours ::]

[Page generation time: 1.84s (PHP: 78% | SQL: 22%) | SQL queries: 78 | GZIP disabled | Debug off]