Moxys System Development Journal
Results 1 to 6 of 6

Thread: Moxys System Development Journal

  1. #1
    I have decided to record my very first system development. I've done programming in my other life for the previous 20 years and have opted 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 really good read and reveals the step on the best way to go from thought, into development through to analyzing and deciding if the system is really worth trading. It got my own development juices flowing so hopefully I shall pick some MQL abilities along the way whilst developing my very first mechanical trading system.

    That I plan to use the example system provided in the publiion and will be able to replie the books findings and might be, just might be, enhance on the system.

    To start with I will explain the system and establish the basic logic that I will be able to code and test. From there I shall carry out the a variety of test explained in the novel and add a few of my own.

    If anybody wishes to join in or follow along, please feel free. The further help / pointers I've in the right direction the better

    significant point to consider: I am not a seasoned trading system developer!!


    Method Description:
    This really is a simple moving average (MA) crossover system with a slight twist. Rather than the MA crossover being a signal to put in a transaction this system will utilize the high/low of this closed pub as soon as the MA crossed because the trigger price to enter the trade. An order in the opposite direction will close the present position resulting in a reversal of the transaction.

    Inserted Code #91;b#93;Signal:#91;/b#93; FastMA#91;1#93; gt; SlowMA#91;1#93; FastMA#91;2#93; lt;= SlowMA#91;2#93; BuyPrice = High#91;1#93; One Status = GoLong FastMA#91;1#93; lt; SlowMA#91;1#93; FastMA#91;2#93; gt;= SlowMA#91;2#93; SellPrice = Reduced #91;1#93; # 1 Status = GoShort #91;b#93;Order Trigger:#91;/b#93; IF (Price gt;= BuyPrice Status = GoLong) IF (Ranking = Short) Then Close Brief Position at Market END-IF Buy (with a Market Order) #8230; Permit 3 pip slippage Ranking = Long #8230;#8230;#8230;. IF (Price lt;= SellPrice Status = GoShort) IF (Ranking = Extended ) Then Close Long Position at Market END-IF Sell (with a Market Order) #8230; Permit 3 pip slippage Ranking = Brief Notes:
    Just Market orders are to be utilized. No BuyStop or SellStop orders.

    The logic above reveals a signal in the opposite direction will close 1 place and open another from the opposite direction.

    Extern variables for SL, TP and Trailing stop should be made available and applied to the order at time of order entry.

    Cheers,

  2. #2
    They truly don't seem that too far away to me. I'd stick at it if I were you, you are going to receive something good eventually.

    What were you hoping for results when compared with the book?

  3. #3
    So why are the results so different? Lets look at the two major differences between the 2 examinations:

    The book runs the backtests on GBPUSD on a 30 minute interval however, the authors use the futures markets rather than the spot forex market which I am using with MT4. Each tick in the futures market is worth $6.50, whereas in the spot forex market a one tick move on a one lot is worth $10. The genuine tick worth in my mind shouldn't determine whether a system will be profitable or not, but it will impact the true dollar profit produced from the system.
    Another point to notice is that the book runs the backtest with zero slippage without any commission costs.

    If you consider this information, this could account for the big difference in performace I am visiting. The futures markets frequently possess at least a one point spread on GBP/USD and if liquidity is thin you can easily see a 2 or 3 ticks spread. On the spot forex side of things the spread is quite similar but very rarely gets below 2 ticks. When I executed the backtest the MT4 Symbol possessions were showing around a 2.5 tick disperse. To see if we can bring the outcomes of both back evaluations into line (or at least a little bit closer) let us do some simple math to ascertain what the outcomes might be if we exclude the 2.5 tick disperse from the MT4 backtest results. Also notice the MT4 back evaluations will frequently give slippage due to how it calculates the person ticks for our backtest. I'm going to provide the MT4 BackTest outcomes some leeway and account for a total of three ticks (combined spread and slippage).

    The entire number of trades in the NT 4 BackTest has been 1892. Let's multiplied this number by 3 lending 5676, and let us multiply that by $10 giving a consequence of $56,760. The MT4 BackTest results showed a total net profit of $99,119. If we put in on the 56,760. This will bring our total net profit to -$42359. Hmm, still fairly crap.

    One thing to remember when comparing the 2 sets of outcomes is that initial test is actually only a starting point and is to be used to decide if the system will have the makings of a viable profitable trading system. The BackTest results described in the book do show a wonderful steady rising equity curve. It does have drawdowns, but these drawdowns quickly recover, and the machine achieves new equity highs on a constant basis. The MT4 equity curve on the other hand, has a steady decrease.

    So, though I am convinced, after reading the book, this trading process is profitable from the futures markets, I am left wondering whether it's worth continuing to research this system. As I mentioned above, this initial preliminary test is to learn if the system shows promise and can be made to a viable profitable trading system. Looking at the outcomes of the MT4 BackTest using a diminishing equity curve, it will not look very promising in any way. I really don't know just why the machine doesn't come anywhere near the operation of that described in the book. May be it is due to the caliber of information we have access to in MT4 or might function as two distinct markets, even though based on the same underlying instrument, behave in a very different manner. Or maybe it's the caliber of the tools used to BackTest the machine. The authors of this book used Trade-Station for the majority of their testing and by all reports Trade-Station is held in very large regard.

    Any thoughts are extremely welcome.

    I believe my next step with system development will be to look for a brand new system to test. There is not any point flogging a dead horse!! Although I don't want to lay this system entirely to break.

    If anybody has any system thought they think is well worth looking into, drop me a message and lets see what we can produce. I am not just going to code EA's for anybody, you'll need to put in some effort yourself by simply describing why you believe a system is well worth coding. Also, remember, I am not an experienced MT4 coder, so maintain the systems as simple as possible (they are the best anyway).

    For anybody interested, I have attached the MQ4 document I made for the exam.

    https://www.nigeriaforextrading.com/...1748930674.mq4

    Cheers,

  4. #4
    Quote Originally Posted by ;
    They really don't seem that too far off to me. I'd stick at it if I were you, you are going to receive something good eventually.

    What were you expecting for outcomes as compared to the book?
    Hello TraderHotch,

    Thanks for stopping by. The outcomes in the book show a constant rising equity curve with short amounts of draw down. The MT4 outcome, even though showing similar% winning trades . . Includes an extremely consistent declining equity curve. It looks almost the reverse of that shown in the publiion.

    The system described in the publiion does move on to apply several filters, take profit and stoploss amounts that result in a really consistent profitable system. I had planned to do the same with the MT4 version and probably will as curiosity will get the better of me and that I will want to see how the system will do later applying the filters.

    Cheers,

  5. #5
    The reverse would entail uncontrolled swings no?

    In case you had the exact same information as the publiion there might be reason to me personally distressed, but so far so good. Keep at it and you're going to get somewhere eventually.

  6. #6
    I spent some time turning the pseudo logic to MT4 code. With this being the primary system I've coded it is fair to say I had some'issues', but with perseverance I was able to complete the programming to allow me to run the first tests of the machine to see how it performs in relation to the results printed in the book.

    I said in the previous article the book got my development juices flowing , which gave me the push to provide the system coding a try. After running several back tests, I am now able to say those juices are soaked up and I'm almost completely dry. My backtest results are like chalk when compared with the book's cheese. The machine performs nowhere near what's recorded in the book.

    What a pain in the arse.

    The results are so distinct, it seems pointless continuing the testing that I had intended. To give you an idea of the gaps. Here are some of the main figures from the book compared to those found in my backtesting.

    Inserted Code | Book | MT4 Backtest -------------------------------------------------------- Total net profit | $66,318 | - $99,190 Gross profit | $590,530 | $523,014 Gross loss | $524,213 | $622,133 Profit factor | 1.13 | 0.84 Total number of trades, | 1913 | 1892 Percent profitable | 36.49percent | 33.67% Winning transactions | 698 | 637 Losing trades, | 1215 | 1255 Average commerce internet profit | $35 | - $52 Average winning trade | $846 | $821 Average losing trade | $431 | $495
    Cheers,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.