MTDS limit order TTL
Originally from ticket #3716.
Hi Tom,
I work with limit orders. After an entry a limit order incl. offset is placed with a preset TTL --> okay, works great.
My problem:
When I get another/2nd entry in the same direction within the TTL of the first entry, the entry is obviously ignored and the limit order remains at the first entry. --> So. I would like to have entries accepted regardless of the TTL limit setting of the last entry.
Is there a way e.g. CancelOrder(IOrder) or cancel all orders that I can code myself when a new entry is triggered. This would help a lot,
Thanks,
Anton
1. you could move the order -
on barUpdate - test logic - call this
etc ChangeOrder(orderEntry1, orderEntry1.Quantity, NewStopPrice, NewLimitPrice);
>>>>>that might be the best solution<<<<<<<
2. you could cancel the entry and resubmit it
on barUpdate - test logic - call this
if (OrderIsActive(orderEntry1) ) CancelEntry();
3.you could build in cancellation rules - possibly that would work before the execute....not 100% sure
this gets called in the code:
"if (customCancel > 0 && OrderIsActive(orderEntry1) && CustomTradeEntryCancelValidate(orderEntry1, customCancel)) CancelEntry();"
you would simply add your logic into the CustomTradeEntryCancelValidate method - please see the SDK example Price Action
"MTDS SDK Price Action";
public override bool CustomTradeEntryCancelValidate(IOrder orderEntry, int customCancel)
{
if (customCancel == 0) return false;
bool result = false;
if(orderEntry.OrderAction==OrderAction.Buy)
{
//if some condtion return true to cancel
result = true;
}
else if (orderEntry.OrderAction == OrderAction.SellShort)
{
//if some condtion return true to cancel
result = true;
}
return result;
}
MicroTrends Support
support@microtrends.co
http://www.microtrends.co/support/
Tip! You can visit the help desk forum to see previous answered frequently asked questions:
http://microtrends.zendesk.com/forums
Please sign in to leave a comment.
Comments
0 comments