I am slowly honing in on the logic holes.
TB is still missing a lot of the Normal demo trades that TOB is happily taking on my live account - more than can be accounted for by the different feed.
I found another huge hole in the logic a few minutes ago. Before 'sending' a Normal pending trade, TB checks to see if there is a filled one open already. I had it coded to spot open trades by (not being closed AND the virtual magic number) but forgot to tell it that the trade symbol and the chart symbol for the open trade must tally.
So, TB was regarding any open Normal trade as belonging to the chart it was checking, so here is what I think was happening, taking potential sells as an example:
TB is still missing a lot of the Normal demo trades that TOB is happily taking on my live account - more than can be accounted for by the different feed.
I found another huge hole in the logic a few minutes ago. Before 'sending' a Normal pending trade, TB checks to see if there is a filled one open already. I had it coded to spot open trades by (not being closed AND the virtual magic number) but forgot to tell it that the trade symbol and the chart symbol for the open trade must tally.
So, TB was regarding any open Normal trade as belonging to the chart it was checking, so here is what I think was happening, taking potential sells as an example:
- market passes the upper dashed magenta line, so tb sets up the pending sell
- market breaches the upper magenta line and moves it higher. As this invalidates the pending price, the relevant global is deleted.
- whilst all this is happening, a different instance of TB has filled a pending Normal trade. When TB goes looking to see if there is a trade open already, the hole in my logic means it regards all open Normal trades as being its own, so it does not want to send another unless the new one would be an acceptable distance beyond the old one. This can often be the case, which explains some trades being sent.
The fix for this is in post 1. It may be worth re-setting your demo accounts in light of this fix - I am going to.
Getting there slowly.
TB is still not ready for live account trading.