amazing work on Desky!!
Lots of pips since implementing. Just need to keep track of the profitability of each variation I am currently running.
Probably. Don't really know. Not had the same position.c1borg » Wed Jan 30, 2019 8:39 pm wrote: The 2 pending orders with FLAT signals dont seem to be deleted is this the correct behaviour?
Curious as it has now decided to delete some pending tradesSteveHopwood » Wed Jan 30, 2019 9:32 pm wrote:Probably. Don't really know. Not had the same position.c1borg » Wed Jan 30, 2019 8:39 pm wrote: The 2 pending orders with FLAT signals dont seem to be deleted is this the correct behaviour?
![]()
Code: Select all
//Code to delete pending orders when the signal goes FLAT,
//then replace them when the signal turns back to trading.
DoPendingOrdersDeletionAndReplacement(symbol, signal);
//Lot size based on account size
Many thanks againSteveHopwood » Wed Feb 06, 2019 6:01 pm wrote:V 2r is in post 1, in response to c1borg's post in the Confused thread: http://www.stevehopwoodforex.com/phpBB3 ... 32#p166032
The code that deletes pending orders on a FLAT signal was underneath the code that detects a NONE signal and stops Desky from doing anything at all. We do not want that, so I have moved the code higher.
Easy DIY. Do a search for, "//Code to delete pending orders when the signal goes FLAT,". Delete the block of code.
Then do a search for, " //Lot size based on account size" and insert the code block you just deleted, just above the lot calculation block. Your code will look like this:I will work out an 'orphaned' pending trade function to pick up on anything else like this.Code: Select all
//Code to delete pending orders when the signal goes FLAT, //then replace them when the signal turns back to trading. DoPendingOrdersDeletionAndReplacement(symbol, signal); //Lot size based on account size
![]()
Code: Select all
//Pending order deletion following a FLAT or opposite direction signal.
extern bool DeletePendingOrdersOnFlatSignal=true;
extern bool DeletePendingOrdersOnOppositeSignal=true;
Code: Select all
//Stop/limit orders sent when SendPendingTrades is enabled
if (SendPendingTrades)
if (DeletePendingOrderWhenSignalChanges)
if (PendingTradesTotal > 0)
{
//Long pendings
if (BuyStopOpen || SellStopOpen)
if (signal != LONG)
{
DeletePendingOrders(symbol);
CountOpenTrades(symbol);
}//if (signal != LONG)
//Short pendings
if (SellStopOpen || SellStopOpen)
if (signal != SHORT)
{
DeletePendingOrders(symbol);
CountOpenTrades(symbol);
}//if (signal != LONG)
}//if (PendingTradesTotal > 0)
Hi Steve, I'm using grid orders and it doesn't appear to be deleting pending orders on opposite or flat signals, both are enabled.SteveHopwood » Fri Feb 08, 2019 12:14 pm wrote:V 2s is in post 1.
c1borg solved the conundrum of the non-deleted pending orders. He spotted that I had coded only the grid orders, not those generated when SendPendingTrades is enabled.