BarsSinceEntry

Questions about MultiCharts and user contributed studies.
smashthepound
Posts: 82
Joined: 20 Jun 2009
Been thanked: 1 time

BarsSinceEntry

Postby smashthepound » 25 Jan 2010

Normally 'BarsSinceEntry' is based on Data1.

If I have a second instrument as Data2 which has a higher timeframe as Data1 can anybody confirm if the expression

BarsSinceEntry (00) of Data2

will deliver the correct value?

I know I can check myself but maybe somebody has already done before ...

Thanks for your help.

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 25 Jan 2010

I would simply track this by watching if MP <> MP[1] and setting a variable in this case to currentbar of data2.

smashthepound
Posts: 82
Joined: 20 Jun 2009
Been thanked: 1 time

Postby smashthepound » 27 Jan 2010

Thanks Bruce. Good idea ... please see below how I solved this issue:

*****************************************************
if Marketposition(0) <> 0 and BarsSinceEntry(0) > 0
then counter = BarNumber of Data2 ;
if Barnumber of Data2 > counter then
barsback = CurrentBar of Data2 - counter ;

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 27 Jan 2010

Great, glad you found a solution that works for what you need. Good luck to you!


Return to “MultiCharts”