Function to print the Time Scale in use

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1273
Joined: 23 Nov 2010
Has thanked: 721 times
Been thanked: 222 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: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Function to print the Time Scale in use

Postby TJ » 11 Jul 2011

arjfca wrote: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.
These users thanked the author TJ for the post (total 3):
arjfcaStan BokovJoshM

arjfca
Posts: 1273
Joined: 23 Nov 2010
Has thanked: 721 times
Been thanked: 222 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: 1273
Joined: 23 Nov 2010
Has thanked: 721 times
Been thanked: 222 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
These users thanked the author arjfca for the post (total 3):
Stan BokovTJJoshM

User avatar
TJ
Posts: 6598
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1909 times

Re: Function to print the Time Scale in use

Postby TJ » 12 Jul 2011

arjfca wrote: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”