To synchronize positions in MultiCharts before starting autotrading please use the signal below.
By the moment autotrading is turned on there might be some signals on history data which result in MultiCharts thinking there is an open position. For autotrading to start from scratch these positions must be closed. The signal below will help you do that.
If you need any further explanations please let me know.
POSITION SYNCHRONIZATION FOR AUTOTRADING
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
POSITION SYNCHRONIZATION FOR AUTOTRADING
- Attachments
-
- AT_Initializer.zip
- (861 Bytes) Downloaded 347 times
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
Hi Marina,
When I read the code I had the suspect that was not working when IOG is set to true, but I have verified that it works even in this situation, so no problem !
I think that few people are testing the IOG and since I'm using this feature only to emulate the old-style limit orders, I would suggest again to consider to add the option of "emulate" the old-style limit/stop order in the next MC realease/SP, please consider the fact that the emulation using IOG even if is solid like a rock will require a lot of changes on current strategies (*).
thanks for the question,
Danilo
(*) I'm just asking to save the old code, not to write a new one.
When I read the code I had the suspect that was not working when IOG is set to true, but I have verified that it works even in this situation, so no problem !
I think that few people are testing the IOG and since I'm using this feature only to emulate the old-style limit orders, I would suggest again to consider to add the option of "emulate" the old-style limit/stop order in the next MC realease/SP, please consider the fact that the emulation using IOG even if is solid like a rock will require a lot of changes on current strategies (*).
thanks for the question,
Danilo
(*) I'm just asking to save the old code, not to write a new one.
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
Hi danilo,
With the conversion timeout set to 0 seconds (the conversion of limit/stop orders to price orders), the new autotrading will work the same way it worked before.
At this point, this feature does not work correctly of a bug. But the bug has already been fixed and will be included in the MultiCharts service pack.
Regards.
With the conversion timeout set to 0 seconds (the conversion of limit/stop orders to price orders), the new autotrading will work the same way it worked before.
At this point, this feature does not work correctly of a bug. But the bug has already been fixed and will be included in the MultiCharts service pack.
Regards.
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
I'm using the following code:Hi Danilo,
Just to make sure that we are on the same page: which code did you use in the AA mode?
Thanks for clarifications.
Code: Select all
[intrabarordergeneration = false];
var : intrabarpersist processed(false);
if 1=getappinfo(aistrategyauto) and LastBarOnChart_s and not processed then begin
sell all contracts this bar at c;
buytocover all contracts this bar at c;
processed = true;
end;
Danilo
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007