My shell EA code
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: My shell EA code
Were I coding this now, there would be an explanatory comment. Back then, I did not realise how useful comments are when I look at code further down the line.

Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- NeoTrader
- Trader
- Posts: 436
- Joined: Wed Apr 04, 2012 2:52 pm
- Location: small Village at Lake Chiemsee, Bavaria, Germany
Re: My shell EA code
Hi Steve,
happy trading,
NeoTrader
-
It is never to late to start with it... good documented code is the key to be able to see what your thoughts where when you actually wrote the code...and helps you to spare a bunch of time when you look back on it at a later time...SteveHopwood wrote:Were I coding this now, there would be an explanatory comment. Back then, I did not realise how useful comments are when I look at code further down the line.
happy trading,
NeoTrader
-
-
FreddyFX
- Trader
- Posts: 28
- Joined: Sun Dec 04, 2011 6:51 pm
- Location: Puerto Vallarta - Mexico
Re: My shell EA code
Starting my first steps in the coding field, keeping that in mind !!!
Trading forex is easy, making money is simple.
It is the mental part that is difficult.
It is the mental part that is difficult.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: My shell EA code
Latest version of the Bare Bones shell in post 1; fixed a few bloops and added Baluda's fantastic trading hours function.
I have created a 10.2A shell; this is also in post 1.

I have created a 10.2A shell; this is also in post 1.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- Carioca
- Trader
- Posts: 49
- Joined: Sat Jun 09, 2012 12:12 am
Re: My shell EA code
Many thanks to Steve and you all for this code.
With one month ago I did not even know make a comment now I'm creating my EAs in minutes.
Most of of my Eas that I am creating exactly what is happening and spoken at the end of the start () to the start the EA if conditions are favorable instantly opens a trade and then hit a tp or some other exit he opens another trade successively.
I read the explanation at the end of the start () more for I understand little English and google translator not this helping.
Maybe this question is a little newbie
I shall replace "some_condition" by what?
if (OldAsk <= some_condition) SendLong = false;
if (OldBid + = some_condition) SendShort = false;
thanks
With one month ago I did not even know make a comment now I'm creating my EAs in minutes.
Most of of my Eas that I am creating exactly what is happening and spoken at the end of the start () to the start the EA if conditions are favorable instantly opens a trade and then hit a tp or some other exit he opens another trade successively.
I read the explanation at the end of the start () more for I understand little English and google translator not this helping.
Maybe this question is a little newbie
I shall replace "some_condition" by what?
if (OldAsk <= some_condition) SendLong = false;
if (OldBid + = some_condition) SendShort = false;
thanks
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: My shell EA code
It is there in the code, but not actually used.Carioca wrote:Many thanks to Steve and you all for this code.
With one month ago I did not even know make a comment now I'm creating my EAs in minutes.
Most of of my Eas that I am creating exactly what is happening and spoken at the end of the start () to the start the EA if conditions are favorable instantly opens a trade and then hit a tp or some other exit he opens another trade successively.
I read the explanation at the end of the start () more for I understand little English and google translator not this helping.
Maybe this question is a little newbie
I shall replace "some_condition" by what?
if (OldAsk <= some_condition) SendLong = false;
if (OldBid + = some_condition) SendShort = false;
thanks
Congratulations at starting to write your own ea's.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- cuzgeorge
- Trader
- Posts: 674
- Joined: Mon Mar 05, 2012 10:10 am
- Location: Johannesburg, South Africa.
Re: My shell EA code
Well done Carioca,Carioca wrote:Many thanks to Steve and you all for this code.
With one month ago I did not even know make a comment now I'm creating my EAs in minutes.
Most of of my Eas that I am creating exactly what is happening and spoken at the end of the start () to the start the EA if conditions are favorable instantly opens a trade and then hit a tp or some other exit he opens another trade successively.
I read the explanation at the end of the start () more for I understand little English and google translator not this helping.
Maybe this question is a little newbie
I shall replace "some_condition" by what?
if (OldAsk <= some_condition) SendLong = false;
if (OldBid + = some_condition) SendShort = false;
thanks
small steps, and off you go...
i'm jealous like, crazy jealous,
well done and hope you can help us out with probs in the near future.
regards and well done again. Its a great feeling when it works huh?
cuz.
10.X, BMac,Xmeter,Marylin,and CaptsNakedTrading thread coupled with Slowkeys Intraday setup for manual trades.
http://www.stevehopwoodforex.com/phpBB3 ... f=36&t=848
http://www.stevehopwoodforex.com/phpBB3 ... f=36&t=848
- gaheitman
- Trader
- Posts: 655
- Joined: Tue Nov 15, 2011 10:55 pm
- Location: Richmond, VA, US
Demo Trading Only
I think we should hard-code demo/testing mode only in the code that we post. We generally post nice disclaimers in the forum, but I am certain that our code ends up on other sites. By hard coding it in, anyone can play with it in demo, but if they want to use it in live they would have to edit the source and recompile the code. That means they are smarter than a box of rocks and would be using a derivative work.
An easy way to do it:
In declarations section:
At the top of Init()
At the top of Start()
Maybe I'm being overly fearful, but I live in the US and we'll sue for any reason. (There will probably be a class action suit against me for libel now.
)
George
An easy way to do it:
In declarations section:
Code: Select all
bool EADisabled=false;
Code: Select all
if (!IsDemo() && !IsTesting()) {
Alert(WindowExpertName( ) , ": Error - Live trading is disabled.");
EADisabled=true;
return(-1);
}
Code: Select all
if (EADisabled) return(-1);
George
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: Demo Trading Only
I used to George, but some crims treat demo accounts as live accounts, so ea's with this feature do not run on demo accounts either.gaheitman wrote:I think we should hard-code demo/testing mode only in the code that we post. We generally post nice disclaimers in the forum, but I am certain that our code ends up on other sites. By hard coding it in, anyone can play with it in demo, but if they want to use it in live they would have to edit the source and recompile the code. That means they are smarter than a box of rocks and would be using a derivative work.
An easy way to do it:
In declarations section:At the top of Init()Code: Select all
bool EADisabled=false;At the top of Start()Code: Select all
if (!IsDemo() && !IsTesting()) { Alert(WindowExpertName( ) , ": Error - Live trading is disabled."); EADisabled=true; return(-1); }Maybe I'm being overly fearful, but I live in the US and we'll sue for any reason. (There will probably be a class action suit against me for libel now.Code: Select all
if (EADisabled) return(-1);)
George
Ok, so we could say, "In that case, go to a different crim" but that is not a lot of help if the member already has their live funds with one of these comedians.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- gaheitman
- Trader
- Posts: 655
- Joined: Tue Nov 15, 2011 10:55 pm
- Location: Richmond, VA, US
Re: Demo Trading Only
Man, if they get that wrong when configuring their servers, what else are they getting wrong?SteveHopwood wrote:I used to George, but some crims treat demo accounts as live accounts, so ea's with this feature do not run on demo accounts either.gaheitman wrote:I think we should hard-code demo/testing mode only in the code that we post. We generally post nice disclaimers in the forum, but I am certain that our code ends up on other sites. By hard coding it in, anyone can play with it in demo, but if they want to use it in live they would have to edit the source and recompile the code. That means they are smarter than a box of rocks and would be using a derivative work.
An easy way to do it:
In declarations section:At the top of Init()Code: Select all
bool EADisabled=false;At the top of Start()Code: Select all
if (!IsDemo() && !IsTesting()) { Alert(WindowExpertName( ) , ": Error - Live trading is disabled."); EADisabled=true; return(-1); }Maybe I'm being overly fearful, but I live in the US and we'll sue for any reason. (There will probably be a class action suit against me for libel now.Code: Select all
if (EADisabled) return(-1);)
George
Ok, so we could say, "In that case, go to a different crim" but that is not a lot of help if the member already has their live funds with one of these comedians.
Argh.
George