Index futures automation

Can a fully automated trading strategy work in the long run?

  • YES!

    Votes: 56 67.5%
  • Hell naw.

    Votes: 14 16.9%
  • I don't know, I got my own trading to worry about.

    Votes: 13 15.7%

  • Total voters
    83
I just can't stand MT5 to be honest. I keep seeing error in execution

View attachment 312137

View attachment 312138

View attachment 312139

upload_2023-4-18_15-56-0.png


upload_2023-4-18_15-56-14.png


upload_2023-4-18_15-56-24.png
 
It sets an incorrect target after a stop and reverse when the net postion turns zero momentarily. ex long 5 lots, short 5 lots, short 5 lots.

The times where it reverses all full position, target is correct. I have a feeling that the code doesn't know how to handle that net zero position. This pattern happened twice, and thought it got fixed initially.

Finally got back from my dev lol

I investigated the problem. Indeed we know that the partial filling of reverse order may produce several deals like "out"; "out/in"; "in" instead of one deal of "out/in" type. Last release I'd corrected the version 5.5 so that it counts two types of deals: "out"; "out/in" (not only "out/in").

But April 17 we see the similar situation: the EA becomes "blind" for the [negative] profit of the "out" deal #22776861 BUY 4.0 ($-156.00) 08:33:32 (13:33:32). I find only one explanation: when broker exchanged the deal BUY 4.0 then that position (SELL 4.0) was fully finished by MT5 terminal's executing system. Then the terminal MT5 opened "new" position with new ID by the broker's technical deal #22776862 BUY 4.0. It's outrageously if it's indeed so. After all, in fact, this is the same position (in the conditions of netting-account), it's just subjected to a reverse. So that position must have the same position's ID.

So now we must very complicate the EA by functions of connecting "different" sequental positions (with different positions' IDs) to correctly calculate the process' entire profit. It's necessary for correct target placing in conditions of "full" closure of some positions (zero-position producing) by partial filling of reverse STOP-orders.

Basically it seems that if the netting results in zero net position, a new order ID is assigned that causes the algo to misprice the target.

Hopefully it's the right fix this time
 
Last edited:
You're a programmer yourself? I should just hire you :D
I'm not a programmer by profession, though I have studied and programmed in a variety of languages including Fortran, Pascal, FoxPro, C# and R. I took 2 Udemy courses in MQL5 in the summer of 2021 and in August I started paying my dues, learning the ins and outs of futures netting account trade management. My 1st EA, that worked perfectly in demo mode, went haywire in live trading. It somehow entered into a loop that cost me $535 in commissions and the spread, opening and immediately closing MNQ and M2K, all in a couple of seconds. More lessons, each of a different nature, followed. The only way to learn is through live trading.
 
Back
Top