POSITION SYNCHRONIZATION FOR AUTOTRADING

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

POSITION SYNCHRONIZATION FOR AUTOTRADING

Postby Marina Pashkova » 21 Apr 2008

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.
Attachments
AT_Initializer.zip
(861 Bytes) Downloaded 337 times

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Postby danilo » 21 Apr 2008

Marina,

a question :

why you set [intrabarordergeneration = false] and use intrabarpersist ?

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 28 Apr 2008

Hi danilo,

May I ask why you would like to know why the signal is written this way? Has this signal worked for you?

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Postby danilo » 28 Apr 2008

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.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 05 May 2008

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.

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Postby danilo » 05 May 2008

Dear Marina,

This is a great improvement, thanks to have understood the importance of the problem.

Kind Regards,
Danilo

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 07 May 2008

Sure Danilo. Keep us posted about the bugs if you come across any.

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Postby danilo » 13 Oct 2008

Marina,

I have tested the code with the new beta using the AA mode, but It seems that doesn't work, could you verify ?

Regards,
Danilo

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 15 Oct 2008

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.

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Postby danilo » 15 Oct 2008

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.
I'm using the following code:

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;
Regards,
Danilo

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 21 Oct 2008

Hi Danilo,

Could you please clarify what makes you think it doesn't work? What exactly happens when you use the code and how is that different from the expected result?

Thank you!

User avatar
danilo
Posts: 170
Joined: 02 Jan 2007
Location: Italy
Has thanked: 4 times
Been thanked: 9 times

Postby danilo » 21 Oct 2008

Marina,

If I disconnect the autotrading with positions not closed when I reconnect the autotrading the positions aren't closed.

Regards,
Danilo


Return to “User Contributed Studies and Indicator Library”