Topics
Replies
TonyPro
29 Jul 2014, 19:41
( Updated at: 21 Dec 2023, 09:20 )
RE: RE: RE: RE:
The problem is cTrader chart and MT4 chart aren't same for the same trading day. even though I have wrote the same strategy as MT4 using C#, it doesn't work because the difference of two charts. but I know that the datas are same for both of charts. Is there any way to fix it?
Spotware said:
Daily bars start at 17:00 EST and it's not up to cAlgo to change that time.
If you need daily bars to open at 00:00 than you need to specify TimeZone of your cBot.
using cAlgo.API; namespace cAlgo { [Robot(TimeZone = TimeZones.EEuropeStandardTime, AccessRights = AccessRights.None)] public class BarOpen : Robot { protected override void OnStart() { Print(MarketSeries.OpenTime.LastValue); } } }will give you: 21.07.2014 0:00:00
TonyPro said:
Can I set the daily bars start time to 00:00 EST? because my strategy is based on that time.
Spotware said:
Daily bars are aggregated by 17:00 EST which is equal to 21:00 UTC. That's why you see such results.
It is a standard for financial markets to calculate new financial day after closing of american market session.
TonyPro said:
I want to backtest daily data during 2013 ~2014, but the problem is after I point the cursor to one daily bar, the daily info at the bottom bar is wrong. Specifically, the open time start from 21:00, and the open price is 21:00 hour open price, instead of daily open price. but the chart I'm using is daily chart, is this a bug of cTrader?
@TonyPro
TonyPro
21 Jul 2014, 17:50
RE: RE:
Can I set the daily bars start time to 00:00 EST? because my strategy is based on that time.
Spotware said:
Daily bars are aggregated by 17:00 EST which is equal to 21:00 UTC. That's why you see such results.
It is a standard for financial markets to calculate new financial day after closing of american market session.
TonyPro said:
I want to backtest daily data during 2013 ~2014, but the problem is after I point the cursor to one daily bar, the daily info at the bottom bar is wrong. Specifically, the open time start from 21:00, and the open price is 21:00 hour open price, instead of daily open price. but the chart I'm using is daily chart, is this a bug of cTrader?
@TonyPro
TonyPro
18 Jul 2014, 19:28
RE:
TonyPro said: I have fix this by using 'Server.Time', but how to get the current tick price?
I'm developing a cBot. I need to know the datetime of each tick. But the only time related property I find is MarketSeries.OpenTime, which is not what I need. so how to get the current tick datetime in OnTick() method? If I use the C# function DateTime.UtcNow, I can get the current computer datetime, but it will be a wrong dateime if I use it in backtesting. Because every tick will be current computer time. and they are all the same time.
@TonyPro
TonyPro
30 Jul 2014, 11:00
RE: RE: RE: RE: RE: RE: RE: RE:
you are right. MT4 start on Sunday in my broker. I think I should ask my broker to adjust the time of cTrader.
Spotware said:
@TonyPro