• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 2:04pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 2:04pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

PSAR on external array - not on currency pairs IE symbol 0 replies

Pairs Symbol Indi changer for Renko 9 replies

virus or something else: smile symbol becomes a crying symbol 4 replies

2009.03.11 15:41:15Tester memory handler: tester stopped because not enough memory 19 replies

Script: Count your net positions in MT4 for a symbol 1 reply

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: Will converting F# to MQL4/5 improve CPU & Memory usage?
Cancel

Will converting F# to MQL4/5 improve CPU & Memory usage?

  • Post #1
  • Quote
  • First Post: Dec 10, 2021 1:13pm Dec 10, 2021 1:13pm
  •  snikoz-cad
  • | Joined Aug 2020 | Status: Member | 17 Posts
Hey, just wondering if my trading bot should be translated to MQL4 or MQL5?
When I started coding my bot I started off with python but it was too slow
and then I chose F#. Wrote my own backtesting framework and algos.
Long story short, I am loading about 20 years' worth of M1 data for 5 pairs
and calculating signals once a minute.
These calculations take about 1 minute per pair and are performed in parallel.
The key issue is that calculations take a little too long for my liking, a full minute.
Also memory footprint is hovering between 8 to 10GB all the time.
The CPU utilization is almost always near 100%, and all cores are fully utilized.
Would you advise for/against converting this code to MQL4/5?
Does is it have high level abstractions like F# does and is it capable of doing
parallel computations easily? Do you think that the above CPU and memory issues would
be addressed in MQL4/5?
A lot of my data is held in 32 bit floats but most calcs are done on intermediate doubles.
  • Post #2
  • Quote
  • Last Post: Dec 11, 2021 3:16pm Dec 11, 2021 3:16pm
  •  jeanlouie
  • Joined Dec 2010 | Status: Member | 1,566 Posts
If you're planning on using metatrader terminals, then it's probably best you just type things up in mql4/5. 5 is faster than 4 and I recall there is support for multicore/parrallel computing.

Time wise, the biggest concern is just seeing what your calculations are actually doing, and cutting out what doesn't need to be done again. I have a hunch that you're trying to get some statistical or ml values based off the entire 20yr price history in 1min candles, and do this again every new minute with a single updated 1m value. You could run this once instead, give up 1min updating, and save/use the calculated values instead, and perhaps update the full history once a day/week and re-calculate new values once a day/week.

There are also hardware limitations to consider, 20yrs of 1min data for 5 pairs adding up to 10gb sounds about right, if you're intentionally using all this data every minute, then, well forget about calcs, imagine just reading a single 10gb file every minute, it'll really push your hardware. No matter how you store or what data types you use in your calculations, you're not going to get around the size of the data files you want to use, if you want them for calcs every minute.

tldr - ask this question on the general thread on the mql5 forum site, there will be people that know a lot more about mql5 and others that do heavy calc stuff.
 
 
  • Platform Tech
  • /
  • Will converting F# to MQL4/5 improve CPU & Memory usage?
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023