Welcome to the Traders Laboratory Forums.
Trading Indicators Post your custom trading indicators. If you download, remember to click INSTALL.

Reply
Bar Numbering Details »»
Bar Numbering
Platform: EasyLanguage, by Tams Tams is offline
Developer Last Online: May 2012 Show Printable Version Email this Page

Platform: MultiCharts Rating: (1 votes - 5.00 average)
Released: 05-13-2009 Last Update: Never Installs: 4
Re-useable Code Translations Is in Beta Stage  
No support by the author.

Bar Numbering

This indicator is for MultiCharts only.

description: prints the bar number on the screen,
with the option to bold, frame or reverse at specific intervals.

you may apply the numbers to a subchart, or the main chart.

if you want the bar numbers on the main chart:
-- right click on the price scale to select this indicator,
-- drag the price scale to position the numbers


Download Now

File Type: txt Bar_numbering.txt (1.3 KB, 80 views)
File Type: pla Bar_Numbering_(MultiCharts).pla (4.2 KB, 61 views)

Screenshots

Bar Numbering-bar_numbering.gif  

Show Your Support

  • If you like to thanks you by the author -> Click Thanks to the Author
  • This modification may not be copied, reproduced or published elsewhere without the author's permission.
The Following 2 Users Say Thank You to Tams For This Useful Post:
aaa (05-13-2009), TIKITRADER (12-14-2009)

Comments
Old 06-06-2009, 12:13 PM   #18
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

Re: Bar Numbering

marketposition is not applicable to this type of study
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0

--------------------------------------------------------------------------------------------------

MarketPosition (Reserved Word)
Disclaimer

Returns a numeric value for a short or long position for the specified position.

MarketPosition(Num)

Where Num is a numeric expression representing the number of positions ago.

Remarks
-1 is returned for a short position, and 1 is returned for a long position. 0 is returned if the current position is specified, and you are not currently in the market.

This function can only be used in the evaluation of strategies.

Example
MarketPosition(0) returns a value of 0 if the current position is flat.
aaa is offline  
Reply With Quote
Old 06-06-2009, 02:21 PM   #19
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 443
Ignore this user

Thanks: 240
Thanked 283 Times in 136 Posts

Re: Bar Numbering

it works better with this correction

date > start.date -1

Code:
Input:	
start.date(	1090601),
start.time(	0800	), 
color(		black	), 
text.size(	8	);
 
var:	
bar_num(	0), 
id_txt(	0);
 
if Time > start.time and date > start.date -1 then 
begin
	if bar_num = 0 then 
	   bar_num = 1 ;
end
else 
bar_num = 0 ;

if bar_num > 0 then 
begin
	id_txt = text_new_self( d, time, 0, text(bar_num : 0 : 0 ) );
		  text_setcolor( id_txt , color     );
		  text_setsize(  id_txt , text.size );
	bar_num = bar_num + 1 ;
end;
  
print(bar_num ) ;
It counts all the bars if, and only if, the start.time = start of the day session (08h00)

But...

It doesnt count all the bars if the start.time = an other time

How to resolve that??
aaa is offline  
Reply With Quote
Old 06-06-2009, 04:06 PM   #20

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Bar Numbering

Quote:
Originally Posted by aaa »
marketposition is not applicable to this type of study
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
--------------------------------------------------------------------------------------------------
MarketPosition (Reserved Word)
Disclaimer
Returns a numeric value for a short or long position for the specified position.
MarketPosition(Num)
Where Num is a numeric expression representing the number of positions ago.
Remarks
-1 is returned for a short position, and 1 is returned for a long position. 0 is returned if the current position is specified, and you are not currently in the market.
This function can only be used in the evaluation of strategies.
Example
MarketPosition(0) returns a value of 0 if the current position is flat.

yes, of course, this is for a strategy.

it starts counting the bars when an order is filled. (i.e. marketposition <> 0)

what you get is the number of bars you have been in a trade.
Tams is offline  
Reply With Quote

Reply

Tags
bar number, easylanguage, multicharts, text

Thread Tools
Help Others By Rating This Thread
Help Others By Rating This Thread:


All times are GMT -4. The time now is 10:56 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.