Cannot Retrieve MarketSeries
Cannot Retrieve MarketSeries
21 Sep 2013, 21:09
In cAlgo, I am unable to retrieve a marketseries from MarketData unless the timeframe matches the timeframe in the current chart instance.
I had a similar issue a few weekends ago. Reinstalling doesn't help. Is the data not available over the weekends?
The code below demonstrates the problem. When the timeframe parameters are the same, the code gets to the second print statement in the Initialize method and to the Calculate method. If the timeframes do not match, then the code does not get past the MarketData.GetSeries method call. I even tried putting in a try catch with no luck.
Would anyone else be willing to copy this into an indicator to see if you experience the same thing in the log tab? I would appreciate it greatly as it would help me to rule out an issue in my configuration/installation.
Thanks!
using System; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; namespace cAlgo.Indicators { [Indicator(IsOverlay = true)] public class TFError : Indicator { [Parameter(DefaultValue = "Minute5")] public TimeFrame TF { get; set; } private MarketSeries ms; protected override void Initialize() { Print("TF: " + TF); ms = MarketData.GetSeries(TF); Print("Only able to get here if TF is the same TimeFrame as the Chart."); } public override void Calculate(int index) { Print("Market: " + MarketSeries.Close.LastValue + " Data: " + ms.Close.LastValue); } } }
Replies
bp2012
21 Sep 2013, 22:38
Thanks Yassine. I'm pretty sure that MTF data was available for indicators on weekends when the functionality first came out. I think something happened in one of the more recent updates.
I tried running the MultiTF_MA indicator provided as a reference and it fails too. Spotware, can you comment on the availability of MTF data on Saturdays and Sundays? It makes sense that Robots should not try to run on non-trading days, but surely indicators should still work. I do most of my coding when the markets are closed as I would prefer to spend my time trading when markets are open. If I have to choose between the two, I suspect that I won't be developing many mtf indicators in the near future.
-bp
@bp2012
Yassine_Mestari
22 Sep 2013, 02:10
they recently added the multi framing , wich is a very good thing , as every thing has a beginning , i think in the futur we'll niot have this problem because they will fixe it , me too i work and MTF iand i have the same poroblem
@Yassine_Mestari
cAlgo_Fanatic
23 Sep 2013, 11:49
This is a bug which will be fixed in the next release.
@cAlgo_Fanatic
Yassine_Mestari
21 Sep 2013, 22:06 ( Updated at: 23 Jan 2024, 13:16 )
i think because it's saturday (sunday)
your answer is here
[/forum/calgo-reference-samples/163]
@Yassine_Mestari