parse from string to Timeframe

Created at 20 Jul 2015, 18:21
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
Paulo_Lira's avatar

Paulo_Lira

Joined 12.02.2014

parse from string to Timeframe
20 Jul 2015, 18:21


Hi i´m making a map about currencies and i need to get some data from a series.

i´m trying to build series with data from a database but Timeframe contructor not let me parse from an string from DB to Timeframe Object


first i tried this...
"var Serie = MarketData.GetSeries(Convert.ToString(rowSymbols["simboloDesc"]), rowSymbols["Timeframe"]);"
  
Then i tried to parse...           
TimeFrame DBtimeframe = TimeFrame.TryParse (rowSymbols["PeriodoTiempoDesc"]), out TimeFrame);
var Serie = MarketData.GetSeries(Convert.ToString(rowSymbols["simboloDesc"]), DBtimeframe);


any suggestion or idea... i´m blocked

regards
         


@Paulo_Lira
Replies

Spotware
21 Jul 2015, 11:27

Dear Trader,

The TimeFrame object does not contain a TryParse(...) method.

MarketData.GetSeries(...)  gets the MarketSeries of market data for the symbol and timeframe.

If we understand correctly you are trying to create a DataSeries using your own data from a database. We recommend you to take a look at the following articles: cAlgo and MySQL thread, at the IndicatorDataSeries reference and at Why is DataSeries read only? thread to get an idea how to create your own DataSeries.

Please note that we do not provide coding assistance services. We more than glad to assist you with specific questions about cAlgo.API. You also can contact one of our Partners or post a job in Development Jobs section for further coding assistance.


@Spotware