Function to print the Time Scale in use

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Function to print the Time Scale in use

Postby arjfca » 11 Jul 2011

Hello

Is there a function to print the time scale in use? Scale time like 1 hours, 3 minutes, daily etc.

Martin

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Function to print the Time Scale in use

Postby TJ » 11 Jul 2011

Hello

Is there a function to print the time scale in use? Scale time like 1 hours, 3 minutes, daily etc.

Martin
do you mean the chart resolution?

use the BarInterval keyword in conjunction with the BarType_ex keyword.

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Function to print the Time Scale in use

Postby arjfca » 12 Jul 2011

Thanks TJ.
AH! My English translator was not in the good section.
use the BarInterval keyword in conjunction with the BarType_ex keyword.
I was looking in the S for scale :)
Martin

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Function to print the Time Scale in use

Postby arjfca » 12 Jul 2011

Just in reference here is the code to get a string of the resolution

Code: Select all

Var: Scale ("");

Scale = NumtoStr(Barinterval,0) + spaces(1);
Switch (bartype_ex) begin
Case = 1:
Scale = Scale + "Ticks";
Case = 2:
Scale = Scale +"Minutes";
Case = 3:
Scale = Scale + "Hours";
Case = 4:
Scale = Scale + "Days";
Case = 5:
Scale = Scale + "Weeks";
Case = 6:
Scale = Scale + "Months";
Case = 7:
Scale = Scale + "Years";
Case = 8:
Scale = Scale + "Volume";
Case = 9:
Scale = Scale + "Seconds";
Case = 10:
Scale = Scale + "Quarters";
Case = 11:
Scale = Scale + "Points";
Case = 12:
Scale = Scale + "Change";
Case = 13:
Scale = Scale + "Points";
default:
scale = scale + "Scale";
end;
Martin

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Function to print the Time Scale in use

Postby TJ » 12 Jul 2011

Just in reference here is the code to get a string of the resolution... Martin
wow... this is good !

Thanks for sharing.


Return to “MultiCharts”