I'm having problems in how to change the first date loaded using the command line.
Does anyone know how to do this?
command line to change start date
- 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
This works for me:
-----
Edit: I assumed you wanted a programming example, but I see you didn't explicitly aksed that. So for typing it in manually:
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.
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
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.
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: command line to change start date
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.
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.
- 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
I don't understand, sorry. Didn't you meant that the symbol should change back to the data range specified?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.
* * * *
MultiCharts Support, can you explain why this:
Code: Select all
from=1/9/2014, to=10/9/2014
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.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.
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: command line to change start date
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.MultiCharts Support, can you explain why this:Gives a data range from Sep 1 to Sep 10, while the wiki says:Code: Select all
from=1/9/2014, to=10/9/2014
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.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.
- 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
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.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.
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).
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: command line to change start date
You can change the format in Windows settings on your local PC to resolve the issue.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.
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.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?
Please leave us such feature request.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).