Handling Partfills  [SOLVED]

Questions about MultiCharts and user contributed studies.
wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Handling Partfills

Postby wilkinsw » 30 Mar 2016

Hi,

I've looked and can't find any literature on the following. Any advice would be much appreciated.

When I get partfilled, corresponding OCO orders (stop+target) do not get submitted until I'm completely filled.

I would like a partfill to trigger OCO orders corresponding to the partfill size.

Currently, in my code OCO's get submitted once ....

Code: Select all

if postradeisopen(0,counter) then if postradeentryname(0,counter)="entryname0" then arraypositiontracker[1]=1;
ie when the position is detected for a given entryname, the OCOs (for the entryname position) get sent. It would appear that the above code is returning "0" when partfilled. Therefore my OCOs don't get submitted.

How else might I 1) detect a given position relating to a specific entryname is open AND 2) have OCOs submitted with size corresponding to the size filled, whether partial or complete?

Thanks

User avatar
Katrin Yanenko
Posts: 55
Joined: 28 Nov 2011
Has thanked: 18 times
Been thanked: 23 times

Re: Handling Partfills

Postby Katrin Yanenko » 01 Apr 2016

Hi,

We have discussed your request with the developers and have searched for possible solutions. But the current software architecture does not allow to place exit orders on partially filled entries.
You can detect a given position relating to a specific entryname using the following keywords:

PosTradeCount
PosTradeEntryName
PosTradeExitName
Entryname

Best regards,
Katrin

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Handling Partfills  [SOLVED]

Postby wilkinsw » 04 Apr 2016

Thanks Katrin.

So , as these keywords's don't change value until a full fill is completed....

I guess the best workaround is to break entries and exits into 1 contract parts.

So where before we had....

Code: Select all

buy ("longentry") 10 contracts next bar at x limit
instead we can do....

Code: Select all

buy ("longentry1") 1 contracts next bar at x limit

Code: Select all

buy ("longentry2") 1 contracts next bar at x limit
etc etc etc up to a target size (10 lots). Then setup the corresponding exit logic.

So this will now give us logic to have exit orders working in the event of a virtual partfill (where we've failed to get our full 10 lots filled). I assume the trade off will increased latency in getting our orders to market as they will be queued up when being sent by Multicharts.


Return to “MultiCharts”