I have an eod system that trades at the close that I want to translate to multicharts.
I have the 1 min data in data1 and daily bars in data2. I plan to have the system generate the trade at 15:59 so that it gets entered just before the close.
In order to generate the buy/sell signals I would need to calculate indicators using daily data that includes the current incomplete daily bar.
One way to do this is to record daily open, close, high during the day and then make a new array from data2 with the current daily bar added.
But, is there some easier way to do it? If there isnt, then is there some example system where it is done the hard way?
And another question - is there a way for me to use indicators that are read only in my strategies? The indicators do not have functions included.
How do I get incomplete daily bar
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
Re: How do I get incomplete daily bar
Depending on the types of indicators you're using on your daily chart, it's possible that you could take the indicator's value as of yesterday and adjust them to incorporate today's values, based on the current price values, before the day is closed.
For a moving average, for example, it may be fairly easy. For other indicators (like the ADX), it may be a bit harder. It depends on the indicator you're using.
As for the statement:
For a moving average, for example, it may be fairly easy. For other indicators (like the ADX), it may be a bit harder. It depends on the indicator you're using.
As for the statement:
What specifically do you mean here? Can you give an example?And another question - is there a way for me to use indicators that are read only in my strategies? The indicators do not have functions included.
Re: How do I get incomplete daily bar
So, basically I am stuck doing it the hard way, right?
If I put an indicator on the chart, how do I access the data that it plotted? Now, if the indicator has a function that I can call, then no problem, I can just call it and have the indicator recalculated for my strategy. On the other hand, if the indicator is protected so that I cant see the source code and there is no function to call then the only way to get the indicator values would be to read it from the chart (as far as I know).What specifically do you mean here? Can you give an example?
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
Re: How do I get incomplete daily bar
That's right - if the code is read-only and there is no way to know what functions the indicator calls (if any), I think you'd have to read values from the chart.
Re: How do I get incomplete daily bar
Ok, so how do I read the indicator from my code or is that not possible?
Re: How do I get incomplete daily bar
So, basically I am stuck doing it the hard way, right?
If I put an indicator on the chart, how do I access the data that it plotted? Now, if the indicator has a function that I can call, then no problem, I can just call it and have the indicator recalculated for my strategy. On the other hand, if the indicator is protected so that I cant see the source code and there is no function to call then the only way to get the indicator values would be to read it from the chart (as far as I know).What specifically do you mean here? Can you give an example?
- Could you print the result in the output window
- Could you read the value of the indicator from the data window
- What do you want to do with the data. Usually, indicators are calculated for each tick unless you specify to calculate it at the end of it
Good luck
Re: How do I get incomplete daily bar
Please write me some example code that reads the value of an indicator from the data window or chart.
- Could you read the value of the indicator from the data window
- What do you want to do with the data. Usually, indicators are calculated for each tick unless you specify to calculate it at the end of it
Good luck
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: How do I get incomplete daily bar
You can't read the value of the indicator from the data window or chart. In other words:Please write me some example code that reads the value of an indicator from the data window or chart.
- Indicator >> Data Window/Chart >> Print output
- Indicator >> Print output
Code: Select all
var0 = AverageFC( Price, Length ) ;
...
Plot1[Displace]( var0, "Avg" ) ;
Code: Select all
Variables:
var0(0);
var0 = AverageFC(Close, 20);
Print("MA20 is: ", NumToStr(var0, 2));
- ABC
- Posts: 722
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: How do I get incomplete daily bar
Mats,
I am not sure if this would work in your case, but it might be worth trying:
Dublicate the symbol you are using for Data2 in QM. You will probably have to change the exchange name, as otherwise QM will raise an error as the symbol is already present.
Other than that set it up exactly like the original symbol, only change the session close time to 15:59.
Something that might be even better is to just create a custom session template in QM and use this for your original data2 symbol on the chart.
Keep in mind that you will miss the actual close on data2 then and this might affect your indicator values, but if you can live with that it might work for you.
Regards,
Chris
I am not sure if this would work in your case, but it might be worth trying:
Dublicate the symbol you are using for Data2 in QM. You will probably have to change the exchange name, as otherwise QM will raise an error as the symbol is already present.
Other than that set it up exactly like the original symbol, only change the session close time to 15:59.
Something that might be even better is to just create a custom session template in QM and use this for your original data2 symbol on the chart.
Keep in mind that you will miss the actual close on data2 then and this might affect your indicator values, but if you can live with that it might work for you.
Regards,
Chris
Re: How do I get incomplete daily bar
Thank you ABC for being the only one to take the time to understand the problem and propose a solution.
I do not think that it would work though since the daily bars come from the data feed supplier. IE, in daily time frame, mc/qm wouldn't download 1 min or 5 min bars and then construct the daily bar from those but instead just download the daily bars directly.
Now, I could be wrong, of course, and qm could be smart enough to construct the daily bars from a lower time frame if closing time differs from the datafeed one but I would be surprised if that was the case.
I do not think that it would work though since the daily bars come from the data feed supplier. IE, in daily time frame, mc/qm wouldn't download 1 min or 5 min bars and then construct the daily bar from those but instead just download the daily bars directly.
Now, I could be wrong, of course, and qm could be smart enough to construct the daily bars from a lower time frame if closing time differs from the datafeed one but I would be surprised if that was the case.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: How do I get incomplete daily bar
Seriously?Thank you ABC for being the only one to take the time to understand the problem and propose a solution.
Perhaps we're both talking about a different thread here, because I see more replies in this thread than just Chris being the 'only one' to try to help you out.
Don't forget, this is a community forum and not a MultiCharts helpdesk - the other people who contributed to this thread did so in their free time and in a desire to help you out. I personally find it offensive that you downplay their efforts with your quoted comment above. I don't know if other people also find that comment misplaced, but if they do, I can imagine that your further threads get even less responses.
That the knowledgable people in this thread weren't able to give you the answer you wished for, is that a fault of them 'not taking the time' to understand you, or could it be that your wording of the question has some fuzziness and/or fault?
- ABC
- Posts: 722
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: How do I get incomplete daily bar
That is true, I didn't think about that. However if you build a daily bar as a minute bar i.e. 1440 Minute bar or whatever the session length is, this might work.I do not think that it would work though since the daily bars come from the data feed supplier. IE, in daily time frame, mc/qm wouldn't download 1 min or 5 min bars and then construct the daily bar from those but instead just download the daily bars directly.
Now, I could be wrong, of course, and qm could be smart enough to construct the daily bars from a lower time frame if closing time differs from the datafeed one but I would be surprised if that was the case.
Regards,
ABC
Re: How do I get incomplete daily bar
Got an idea for you
You could read your PC time clock with the function Machinetime
This function will return, as it said, the time of your machine. Make sure that you sync it periodically.
Now, knowing when you daily bar finish every day, it is easy to built a code to send your order if your machine time do it your desire time of the day
Hope it help
Martin
You could read your PC time clock with the function Machinetime
This function will return, as it said, the time of your machine. Make sure that you sync it periodically.
Now, knowing when you daily bar finish every day, it is easy to built a code to send your order if your machine time do it your desire time of the day
Hope it help
Martin