Discovering MQL4 Alternatives: A Custom Simulator for MetaTrader 4

Mike 2014.02.17 22:07 26 0 0
Attachments

Author: Coders' Guru

Hey fellow traders!

As I was diving into the latest features of MQL4 with the new build (610), I came across a handy function called OnTrade() in MetaEditor. Curious as ever, I hit F1 to check out its implementation, but to my surprise, it's not yet supported in MQL4.

So, I decided to roll up my sleeves and create my own simulator! This custom code will trigger events in the following scenarios:

  • OnOpen: When a new instant order is opened.
  • OnModify: When an existing order is modified.
  • OnStopLoss: When an order closes due to hitting its Stop Loss.
  • OnTakeProfit: When an order closes because it reached its Take Profit.
  • OnClose: When an order closes (not due to SL or TP).

I'd love for you to give it a try and share your thoughts with me!

Cheers,

Coders' Guru


Tester example
List
Comments 0