Not all contracts are closed when marketposition reverse

Questions about MultiCharts and user contributed studies.
RS
Posts: 39
Joined: 28 Sep 2007

Not all contracts are closed when marketposition reverse

Postby RS » 22 Nov 2007

Marina,

It looks like that not all open contracts are automatically closed by MC when the marketposition reverses. Contracts are left open until the end of the chart. This gives unexpected results. It only happens when the # contracts in the second order > 1.

Please comment on this. Thanks,

Rob.



If BarNumber = 1 then begin
Sell Short ("Short Entry#1") This Bar 1 contracts on Close;
end;
If BarNumber = 2 then begin
Sell Short ("Short Entry#2") This Bar 2 contracts on Close;
end;
If BarNumber = 3 then begin
Buy ("Long Entry#1") This Bar 1 contracts on Close;
end;
If BarNumber = 4 then begin
Sell This Bar on Close;
end;

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

Postby Marina Pashkova » 22 Nov 2007

Dear Rob,

We ran tests with your code and, according to our results, all the positions got closed.

Could you please send us a screenshot with the List of Trades in the Strategy Performance report - it would show if you have any open positions left.

Thank you.

RS
Posts: 39
Joined: 28 Sep 2007

Postby RS » 22 Nov 2007

Marina,

I do, but it will be monday. Now I'm not at the office and tomorrow I have a conference.

Regards,
Rob.

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

Postby Marina Pashkova » 23 Nov 2007

Ok, Rob. I'll be waiting for the screenshot. You can either post it here or send it to mpashkova@tssupport.com

RS
Posts: 39
Joined: 28 Sep 2007

Postby RS » 26 Nov 2007

Marina,

I attached the screenshot.

Regards,
Rob.
Attachments
open position.jpg
open position.jpg (132.79 KiB) Viewed 683 times

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

Postby Marina Pashkova » 26 Nov 2007

Hi Rob,

What MC version are you using? If it's not the latest 999 version, I would recommend updating. However, if you are using the latest 2.1.999.999 version and still have this problem, please contact us through LiveChat and ask the customer support representative to have a look at the problem via HelpDesk, our remote control utility.

Regards.

RS
Posts: 39
Joined: 28 Sep 2007

Postby RS » 26 Nov 2007

Marina,

I use the latest version. I will call the HelpDesk, propable tomorrow.


Regards,
Rob.

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

Postby Marina Pashkova » 26 Nov 2007

Ok, Rob. We'll be glad to help you. Please note that the customer support hours are 6:30 am - 4:00 pm EST.

Regards.

User avatar
ABC
Posts: 593
Joined: 16 Dec 2006
Has thanked: 118 times
Been thanked: 336 times
Contact:

Postby ABC » 26 Nov 2007

Rob and Marina,

I am not sure if there is a problem at all, because the screenshot shows the following to me:
The strategy trades 1 contract all the time, the field "Contracts" doesn't show the currently open contracts. So you enter with 1 contract, you are closing with 1 contract etc..

Hope that helps,
ABC

RS
Posts: 39
Joined: 28 Sep 2007

Postby RS » 27 Nov 2007

ABC,

Thanks for your help.

The strategy does trade with more than one contract, see the code in the start post. The problem is indeed that only one contract is closed when the strategy is turning. The last open contract is closed by default when there is no more symbol data. You can see that there are more than one contracts opened with the same (start) time.

Regards,
Rob.

User avatar
ABC
Posts: 593
Joined: 16 Dec 2006
Has thanked: 118 times
Been thanked: 336 times
Contact:

Postby ABC » 27 Nov 2007

Rob,

you are right, I forgot to turn "Allow up to XX entry orders in the same direction..." on, that's why I had wrong results. With that checked the Performance Report shows Open Position Profit, although you would expect all positions to be closed.

I did a test in TS and there it works like you would expect the strategy to do, like you can see on the attached screenshot.

Best regards,
ABC
Attachments
Screenshot - 27.11.2007 , 06_04_15.png
Screenshot - 27.11.2007 , 06_04_15.png (22.38 KiB) Viewed 667 times

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

Postby Marina Pashkova » 27 Nov 2007

Dear Rob,

Hope the dlls I sent you will fix the problem.

If they don't, let me know.

Regards.

RS
Posts: 39
Joined: 28 Sep 2007

Postby RS » 28 Nov 2007

Marina,

It works! Thanks for the good support and the quick patch for the problem.


With regards,
Rob.

P.S. May I suggest that you supply the dll's to the other forum users also!?

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

Postby Marina Pashkova » 28 Nov 2007

Hi Rob,

I will certainly do it. Thank you for the suggestion.

Best regards.

JT
Posts: 4
Joined: 08 Apr 2008

issue reappeared in 3.1

Postby JT » 10 Sep 2008

I havethis issue again in MC 31; is this the case? If so, can I apply the same patch?

Regards

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

Postby Marina Pashkova » 17 Sep 2008

Hi JT,

I just want to make sure that the problem that you are talking about is actually the same problem as described in the posts above.

I would recommend upgrading to the latest 4.0 beta 2 version of MultiCharts. If the problem is still there, we would need the following to analyze it:

1. Your code (you can modify your original code if you don't wish to reveal the actual code that you have developed)
2. The workspace to which it is applied
3. The description of how your results differ from the expected results.

Or, to make the whole process faster, you could also contact our customer support representatives via LiveChat at http://messenger.providesupport.com/mes ... pport.html
and they will analyze and solve (if possible) your problem on-line.

Best regards.


Return to “MultiCharts”