command line to change start date

Questions about MultiCharts and user contributed studies.
User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

command line to change start date

Postby arnie » 05 Oct 2014

I'm having problems in how to change the first date loaded using the command line.
Does anyone know how to do this?

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

Re: command line to change start date

Postby JoshM » 05 Oct 2014

This works for me:

Code: Select all

Variables:
command("");

once (LastBarOnChart_s = true) begin

command = Text(
".csy name=", SymbolName,
", df=LMAX", // There is no keyword for datafeed?
", from=1/9/2014 ", // September 1
", to=10/9/2014"); // September 9

CommandLine(command);

end;
-----
Edit: I assumed you wanted a programming example, but I see you didn't explicitly aksed that. So for typing it in manually:

Code: Select all

.csy name=EUR/USD, df=LMAX, from=1/9/2014, to=10/9/2014
Though this uses the `.csy` command (Change SYmbol), it still works when your chart already has that symbol (so no "symbol changing" takes place).

In my case, I applied the above command to an EUR/USD chart from LMAX: the symbol and resolution remained the same, while the data range on the chart (from the Format Instrument screen) changed.

User avatar
arnie
Posts: 1594
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 481 times
Been thanked: 514 times

Re: command line to change start date

Postby arnie » 05 Oct 2014

Many thanks JoshM.

I was actually requesting something directly from the command line and not a programmed one, though it's good to know how we can program it.

Though the example you gave directly from the command line works like a charm, the programmed one doesn't.
Well, when I execute the programmed command the chart does indeed start to load the requested data but at the end it gets back to the data that was programmed, in your example, from Sept 1 to Sept 10.

Maybe a programmed command does not work the way I was thinking about. It's usage is to be applied directly on the chart and not to be called from the command line.
I was thinking in the line of us building custom commands.

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

Re: command line to change start date

Postby JoshM » 06 Oct 2014

Though the example you gave directly from the command line works like a charm, the programmed one doesn't.
Well, when I execute the programmed command the chart does indeed start to load the requested data but at the end it gets back to the data that was programmed, in your example, from Sept 1 to Sept 10.
I don't understand, sorry. Didn't you meant that the symbol should change back to the data range specified?

* * * *

MultiCharts Support, can you explain why this:

Code: Select all

from=1/9/2014, to=10/9/2014
Gives a data range from Sep 1 to Sep 10, while the wiki says:
from=12/31/2012, to=5/10/2013 (...) starting from 31th of December 2012 up to 10th of May 2013 as additional data series to the active chart window.
Should the wiki info be correct, "from=1/9/2014, to=10/9/2014" should not load from Sep 1 to Sep 10, but from Jan 9 to Oct 9. But that's not how it works for me and Arnie.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: command line to change start date

Postby Andrew MultiCharts » 06 Oct 2014

MultiCharts Support, can you explain why this:

Code: Select all

from=1/9/2014, to=10/9/2014
Gives a data range from Sep 1 to Sep 10, while the wiki says:
from=12/31/2012, to=5/10/2013 (...) starting from 31th of December 2012 up to 10th of May 2013 as additional data series to the active chart window.
Should the wiki info be correct, "from=1/9/2014, to=10/9/2014" should not load from Sep 1 to Sep 10, but from Jan 9 to Oct 9. But that's not how it works for me and Arnie.
It depends on your Windows settings. On some computers it is set to show DD/MM/YYYY, on others it is set to the format MM/DD/YYYY.

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

Re: command line to change start date

Postby JoshM » 07 Oct 2014

It depends on your Windows settings. On some computers it is set to show DD/MM/YYYY, on others it is set to the format MM/DD/YYYY.
Sorry to say, but that's not very useful. It means that, if I program something on my DD/MM/YYYY Windows pc and upload it to my VPS (that has MM/DD/YYYY), I need to change the code or work with two versions.

And if I use the `.csy` command in an indicator or trading strategy that I share with others, should I then provide two versions? And how about people who have set their Windows to YYYY/MM/DD, will they require a third version?

If the `.csy` command works differently for different people, I think there should be at least a PowerLanguage keyword so that we can programmatically determine which culture somebody has (I couldn't find it).

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: command line to change start date

Postby Andrew MultiCharts » 07 Oct 2014

Sorry to say, but that's not very useful. It means that, if I program something on my DD/MM/YYYY Windows pc and upload it to my VPS (that has MM/DD/YYYY), I need to change the code or work with two versions.
You can change the format in Windows settings on your local PC to resolve the issue.
And if I use the `.csy` command in an indicator or trading strategy that I share with others, should I then provide two versions? And how about people who have set their Windows to YYYY/MM/DD, will they require a third version?
Unfortunately yes, the format must be identical on all computers where the study is going to be used, otherwise you will need to provide different versions of the study.
If the `.csy` command works differently for different people, I think there should be at least a PowerLanguage keyword so that we can programmatically determine which culture somebody has (I couldn't find it).
Please leave us such feature request.


Return to “MultiCharts”