Hello, can anyone help or offer advice for a problem i have encountered?
I wish to export data (OHLC) plus any trades that are executed during a signal test on a chart.....so i use....
print(File(FileName+getsymbolname +".txt"),datetojulian(date),",",open,",",high,",",low,",",close,",",AvgTrueRange(20),",",marketposition - ETC; ETC:);
The problem I get is that when applying this to a very simple signal to different charts/instruments that it starts writing the text file from different dates?
the maxbarsback referenced is 25. Some textfiles start writing at this early date. Others, and seemingly randomly so, start later. eg; 2-Jan 2003
All the charts/data start and end from the same dates...19 Aug 2002 - 21 Aug 2009.
What seems to be happening is that the text file start date only occurs when the signal initially triggers.
Is there a way to record ALL the data from start to finish as a text file?
thanks.
print to file bars back?
thanks for the response...
it probably is that, when its applied in a signal test it only starts printing when a signal is triggered, as opposed to an indicator that prints once the max bars back is reached.
The script is pretty small, just a get long on 20 high day break, sell out when ATR trailing stop is triggered. I am trying to get a feel on how the system works as i am relatively new to programming. So moving it around does not make much difference.
Basically ... given the bugs talked about in the portfolio testing re drawdowns, and the fact that we have our own excel based system (very slow...unfortunately) to test things, what i wanted to do was export the OHLC for each day and then on the same line as them in the text file, any triggers, and other info in a strategy. That way in excel you can really analyse what ever you want. Unfortunatley (unless i have missed something) the performance reports only show the trades and the dates they occur, not a full explanation. And you cant export from the charts trade signals and dates....
it probably is that, when its applied in a signal test it only starts printing when a signal is triggered, as opposed to an indicator that prints once the max bars back is reached.
The script is pretty small, just a get long on 20 high day break, sell out when ATR trailing stop is triggered. I am trying to get a feel on how the system works as i am relatively new to programming. So moving it around does not make much difference.
Basically ... given the bugs talked about in the portfolio testing re drawdowns, and the fact that we have our own excel based system (very slow...unfortunately) to test things, what i wanted to do was export the OHLC for each day and then on the same line as them in the text file, any triggers, and other info in a strategy. That way in excel you can really analyse what ever you want. Unfortunatley (unless i have missed something) the performance reports only show the trades and the dates they occur, not a full explanation. And you cant export from the charts trade signals and dates....
For future reference....
I think it must have had something to do with maxbarsback setting.
I went through and reset every chart as having the same maxbarsback settings, and then rechecked every text file that was written.
Then it worked.
So in summary for any one else who might encounter such an issue, check the max bars back setting on the properties section of each instrument.
That seems to be the only thing i changed and made standard for all charts that made a difference.
On that note....how do i set the max bars back setting in a signal or indicator so that it will be the same for every chart?
I think it must have had something to do with maxbarsback setting.
I went through and reset every chart as having the same maxbarsback settings, and then rechecked every text file that was written.
Then it worked.
So in summary for any one else who might encounter such an issue, check the max bars back setting on the properties section of each instrument.
That seems to be the only thing i changed and made standard for all charts that made a difference.
On that note....how do i set the max bars back setting in a signal or indicator so that it will be the same for every chart?
- Andrew Kirillov
- Posts: 1589
- Joined: 28 Jul 2005
- Has thanked: 2 times
- Been thanked: 31 times
- Contact: