TJ
    
        
            string to timeframe
            
                 09 Mar 2020, 14:41
            
                    
Hi Panagiotis,
Could you please advise how to convert string into timeframe ?
Thank you.
Replies
                     Tj11
                     09 Mar 2020, 15:07
                                    
RE:
PanagiotisCharalampous said:
Hi Tj11,
You can write a function with a switch statement that does the conversion. See an example below
private TimeFrame GetTimeFrameFromString(string timeframeString) { switch (timeframeString) { case "Hour": return TimeFrame.Hour; // . // . // . // . // . // . // . // . } return TimeFrame.Hour; }
Best Regards,
Panagiotis
Thanks a lot, Panagiotis !!!
@Tj11

PanagiotisCharalampous
09 Mar 2020, 14:46
Hi Tj11,
You can write a function with a switch statement that does the conversion. See an example below
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous