I've decided to document my first system development. I have done programming in my other life for the last 20 years and have decided to take the plunge and try to develop a trading system using MQL.
I have been reading a book by Dr Emilio Tomasini and Urban Jaekle called 'Trading Systems: A New Approach to System Optimisation and Portfolio Construction'. It's a very good read and shows the step on how to go from idea, into development through to testing and deciding if the system is worth trading. It got my development juices flowing so hopefully I will pick up some MQL skills along the way whilst developing my first mechanical trading system.
I plan to use the example system given in the book and will hopefully be able to replicate the books findings and may be, just may be, improve on the system.
To start with I will describe the system and identify the basic logic that I will hopefully be able to code and test. From there I will carry out the various test described in the book and add a few of my own.
If anyone wants to join in or follow along, please feel free. The more help / pointers I have in the right direction the better
Important point to remember: I am not an experienced trading system developer!! :nerd:
System Description:
This is a simple moving average (MA) crossover system with a slight twist. Instead of the MA crossover being a signal to enter a trade this system will use the high/low of the closed bar when the MA crossed as the trigger price to enter the trade. An order in the opposite direction will close the existing position resulting in a reversal of the trade.
Notes:
Only Market orders are to be used. No BuyStop or SellStop orders.
The logic above shows that a signal in the opposite direction will close 1 position and open another in the opposite direction.
Extern variables for SL, TP and Trailing stop are to be made available and applied to the order at time of order entry.
Cheers,
I have been reading a book by Dr Emilio Tomasini and Urban Jaekle called 'Trading Systems: A New Approach to System Optimisation and Portfolio Construction'. It's a very good read and shows the step on how to go from idea, into development through to testing and deciding if the system is worth trading. It got my development juices flowing so hopefully I will pick up some MQL skills along the way whilst developing my first mechanical trading system.
I plan to use the example system given in the book and will hopefully be able to replicate the books findings and may be, just may be, improve on the system.
To start with I will describe the system and identify the basic logic that I will hopefully be able to code and test. From there I will carry out the various test described in the book and add a few of my own.
If anyone wants to join in or follow along, please feel free. The more help / pointers I have in the right direction the better
Important point to remember: I am not an experienced trading system developer!! :nerd:
System Description:
This is a simple moving average (MA) crossover system with a slight twist. Instead of the MA crossover being a signal to enter a trade this system will use the high/low of the closed bar when the MA crossed as the trigger price to enter the trade. An order in the opposite direction will close the existing position resulting in a reversal of the trade.
Inserted Code
[b]Signal:[/b] FastMA[1] > SlowMA[1] && FastMA[2] <= SlowMA[2] BuyPrice = High[1] + 1 Status = GoLong FastMA[1] < SlowMA[1] && FastMA[2] >= SlowMA[2] SellPrice = Low[1] - 1 Status = GoShort [b]Order Trigger:[/b] IF (Price >= BuyPrice && Status = GoLong) IF (Position = Short) Then Close Short Position at Market END-IF Buy (using a Market Order) … Allow 3 pip slippage Position = Long ………. IF (Price <= SellPrice && Status = GoShort) IF (Position = Long) Then Close Long Position at Market END-IF Sell (using a Market Order) … Allow 3 pip slippage Position = Short
Only Market orders are to be used. No BuyStop or SellStop orders.
The logic above shows that a signal in the opposite direction will close 1 position and open another in the opposite direction.
Extern variables for SL, TP and Trailing stop are to be made available and applied to the order at time of order entry.
Cheers,