stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Improving CPU speed
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4740
Page 2 of 3
Author:  JonCodesBad [ Sat Jul 02, 2016 8:26 am ]
Post subject:  Improving CPU speed

starger » Sat Jul 02, 2016 2:50 am wrote:

Code: Select all

// on Global Scope

extern bool   LowCPU = true;
extern int     Divisor  =      4;    // only calculate every 4th tic

// first line in start() 
if(LowCPU && Volume[0]/Divisor !=MathCeil(Volume[0]/Divisor)){return(0);}
This worked for me with the older builds of Empty4. The new build should do it, too.
I simply added these lines to my indicators and took different divisors for each indicator.
This does not speed up the the computer but it reduces the number of calculations and distributes the usage of CPU.
I use a similar approach. Normally I go for the 'if price moves by n amount of pips, calculate this, or do this or that.'

I would strongly urge everyone to learn MQL4. It isn't too difficult! Before going live with real money optimize your EA. Just ask yourself, do I need to calculate this every tick, every new bar, every 10 seconds, every 5 pips etc. This can include indicator calls, jumping SL, group closure etc.

Seriously, If I can code basic EA's anyone can! I'm slightly dyslexic and of average intelligence, so the vast majority here have no excuse. :)
Author:  acostafulano [ Sun Jul 03, 2016 8:11 pm ]
Post subject:  Improving CPU speed

Hello!

I've been trying to set the affinity via the shortcut in many ways, and cannot get it to start already configured as per the core instructions I'm looking for. I think there's something wrong with the configuration.

Do you mind sharing a screenshot of how your shortcut is configured as per running under your selected affinity by default?

Thanks!
DigitalCrypto » Wed Jun 29, 2016 1:19 pm wrote:


All of my terminals run in portable mode with affinity set. Affinity is actually a Windows setting. It will assign your Empty4 terminal to run exclusively on a specific core. For example if you have a quad core computer they are 0,1,2 and 3. For a dual core computer you only get 0,1. You can activate it by setting your Empty4 shortcuts with an affinity flag like I show below to run on Core 4.

"C:\Trading\FXCM_Monitor_1\terminal.exe" /portable /affinity 3

Also notice there are no spaces in my directory paths. Empty4 acts funny with spaces particularly if you've installed it in "Program Files" and have Windows UAC (User Access Control) enabled. You will need to run Empty4 in administrator mode if you do or just move it into its own directory like I've done.

.
Author:  DigitalCrypto [ Sun Jul 03, 2016 10:50 pm ]
Post subject:  Improving CPU speed

I could show you a short cut but you wouldn't be able to see the whole command. That's why I posted it. You have to manually change the start menu shortcuts also.
Author:  frenchstep [ Tue Jul 05, 2016 4:31 pm ]
Post subject:  Improving CPU speed

Hi,

I too have not been successful in setting affinity through the shortcut. I have tried everything, when I verify if the affinity is correctly set through Task Manage, I see no affinity is set. If I manually set it, it works but through the shortcut it does not work. Perhaps I have done something wrong. Can someone help please.

Much appreciated
French
Author:  tomele [ Tue Jul 05, 2016 4:53 pm ]
Post subject:  Improving CPU speed

Hi,

you must run it thru the shell:

C:\Windows\System32\cmd.exe /C start /affinity 1 "C:\Program Files (x86)\Global Prime - Empty4 4\terminal.exe"

And bear in mind, that affinity number is converted to a binary number. Call it with 1,2,4,8 to test.

Happy pippin, Thomas
Author:  DigitalCrypto [ Tue Jul 05, 2016 5:04 pm ]
Post subject:  Improving CPU speed

Ahhh maybe it was a Windows 10 thing? I am still on 7 and Linux primarily
Author:  frenchstep [ Tue Jul 05, 2016 6:12 pm ]
Post subject:  Improving CPU speed

Thanks, Windows 10 does not set the affinity. I will try some more research. If anyone does come across an easier way of setting the shortcut permanently in windows 10 would sure appreciate it.

thanks
French
Author:  mejayusa [ Tue Jul 05, 2016 8:16 pm ]
Post subject:  Improving CPU speed

DigitalCrypto » Tue Jul 05, 2016 5:04 pm wrote:Ahhh maybe it was a Windows 10 thing? I am still on 7 and Linux primarily
Is there a trading terminal/software for Linux env?
Author:  investguy [ Sun Oct 23, 2016 2:53 am ]
Post subject:  Improving CPU speed

mejayusa » Tue Jul 05, 2016 3:16 pm wrote:
DigitalCrypto » Tue Jul 05, 2016 5:04 pm wrote:Ahhh maybe it was a Windows 10 thing? I am still on 7 and Linux primarily
Is there a trading terminal/software for Linux env?

Yes. You can use WINE to run Empty4 in Linux. I don't believe it will improve speed though.
Author:  thomasmore [ Sun Oct 23, 2016 10:41 am ]
Post subject:  Improving CPU speed

Hi all,
Reducing bar history and setting core affinity made a big improvement. :clap:
My question: I have a large number of indicators an EA's in the Navigator. Would they use memory, even if they are not on a chart?
Cheers,
Ludo
All times are UTC Page 2 of 3