Reloading charts: Is there a way to do it from code?  [SOLVED]

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

Reloading charts: Is there a way to do it from code?

Postby arjfca » 23 Apr 2017

Hello

I know that I use CTRL +R or a command line but, is it possible to use a code to reload the chart by itself. I need to do it at least every week for all my charts

Martin

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

Re: Reloading charts: Is there a way to do it from code?

Postby TJ » 23 Apr 2017

Hello

I know that I use CTRL +R or a command line but, is it possible to use a code to reload the chart by itself. I need to do it at least every week for all my charts

Martin

put the commandline in your code.

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

Re: Reloading charts: Is there a way to do it from code?

Postby arjfca » 23 Apr 2017

put the command line in your code.
Sure , that is what I would like to do. Don't see any MC code or function to reload.

My idea would be to reload the last day after each new session.

If sessionlastbar[1] then reload(day);

Martin

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

Re: Reloading charts: Is there a way to do it from code?

Postby TJ » 23 Apr 2017

if you want a function,
then put the commandline in the function.
Nobody is stopping you from doing that.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Reloading charts: Is there a way to do it from code?

Postby JoshM » 24 Apr 2017

My idea would be to reload the last day after each new session.

If sessionlastbar[1] then reload(day);
You can use the CommandLine() keyword for that. Here's a list of the different commands you can use.

Code: Select all

if (sessionlastbar[1]) then
CommandLine(".rld int=1 day);
(Although you might want to double-check this to see if my understanding was correct.)

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

Re: Reloading charts: Is there a way to do it from code?  [SOLVED]

Postby arjfca » 24 Apr 2017

Code: Select all

if (sessionlastbar[1]) then
CommandLine(".rld int=1 day);
(Although you might want to double-check this to see if my understanding was correct.)
OK I will test it. If it work then it open up a lot. I never work with Commandline from the code. My understanding was it was used externally like I'm using to set a new scale

Martin


Return to “MultiCharts”