OnBar method unusable
OnBar method unusable
09 Jan 2014, 00:35
Dear Developer,
I use robot for open a position on 12 hours chart . I have an issue, when a new candle opens at midnight. (not always but very often)
FxPro reconcile data from 01:00 to 01:05. Of course the trading halt during this time. So normally, new candle should appear at 01:05 (use OnBar method). But sometime the new candle appears at 01:00 (midnight UTC+3). See attached picure below.
In this case OnBar method unusable.
Please investigate it, as soon as possible.
Thanks in advance!
Replies
Spotware
04 Apr 2014, 13:55
RE:
rkokerti said:
You mean if operation failed, I need to use OnTick method to repeat the functionality of OnBar?
Thanks in advance!
Yes, you can use OnTick method to repeat the failed trade. You can also do Thread.Sleep in OnBar method and then repeat the failed trade.
@Spotware
rkokerti
29 May 2014, 15:55
Dear Developers,
As you previously said "Even if trading is not possible platform can receive new prices which could produce new bar." OK I accept that, I do not understand why, but it's not important...
Therefore, I need to open the half of the positions by manually. In this case very difficult to set the proper SL/TP levels and set the position sizing.
So, please help me to handle this problem with a sample code.
Thanks in advance!
@rkokerti
modarkat
29 May 2014, 16:11
RE:
rkokerti said:
Dear Developers,
As you previously said "Even if trading is not possible platform can receive new prices which could produce new bar." OK I accept that, I do not understand why, but it's not important...
Therefore, I need to open the half of the positions by manually. In this case very difficult to set the proper SL/TP levels and set the position sizing.
So, please help me to handle this problem with a sample code.
Thanks in advance!
You can try the following snippet
while (true) { ExecuteMarketOrder(TradeType.Buy, Symbol, Symbol.VolumeMin); if (LastResult.IsSuccessful) { break; } else { Thread.Sleep(1000); } }
@modarkat
Spotware
Thank you for reporting this issue. We are aware of it and will fix it.09 Jan 2014, 17:17
@Spotware