My shell EA code

Post Reply
User avatar
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

Post by SteveHopwood »

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.

:D
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.
User avatar
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

Post by NeoTrader »

Hi Steve,
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. :D
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...

happy trading,

NeoTrader

-
FreddyFX
Trader
Posts: 28
Joined: Sun Dec 04, 2011 6:51 pm
Location: Puerto Vallarta - Mexico

Re: My shell EA code

Post by FreddyFX »

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.
User avatar
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

Post by SteveHopwood »

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.

:D
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.
User avatar
Carioca
Trader
Posts: 49
Joined: Sat Jun 09, 2012 12:12 am

Re: My shell EA code

Post by Carioca »

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
User avatar
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

Post by SteveHopwood »

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
It is there in the code, but not actually used.

Congratulations at starting to write your own ea's.

:D
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.
User avatar
cuzgeorge
Trader
Posts: 674
Joined: Mon Mar 05, 2012 10:10 am
Location: Johannesburg, South Africa.

Re: My shell EA code

Post by cuzgeorge »

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
Well done Carioca,
small steps, and off you go...

i'm jealous like, crazy jealous, :lol: :lol:
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
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Demo Trading Only

Post by gaheitman »

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:

Code: Select all

bool EADisabled=false;
At the top of Init()

Code: Select all

   if (!IsDemo() && !IsTesting()) {
      Alert(WindowExpertName( ) , ": Error - Live trading is disabled.");
      EADisabled=true;
      return(-1);
   }
At the top of Start()

Code: Select all

  if (EADisabled) 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. :roll: )

George
User avatar
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

Post by SteveHopwood »

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:

Code: Select all

bool EADisabled=false;
At the top of Init()

Code: Select all

   if (!IsDemo() && !IsTesting()) {
      Alert(WindowExpertName( ) , ": Error - Live trading is disabled.");
      EADisabled=true;
      return(-1);
   }
At the top of Start()

Code: Select all

  if (EADisabled) 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. :roll: )

George
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.

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.

:D
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.
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Demo Trading Only

Post by gaheitman »

SteveHopwood wrote:
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:

Code: Select all

bool EADisabled=false;
At the top of Init()

Code: Select all

   if (!IsDemo() && !IsTesting()) {
      Alert(WindowExpertName( ) , ": Error - Live trading is disabled.");
      EADisabled=true;
      return(-1);
   }
At the top of Start()

Code: Select all

  if (EADisabled) 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. :roll: )

George
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.

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.

:D
Man, if they get that wrong when configuring their servers, what else are they getting wrong?

Argh.

George
Post Reply

Return to “Coders Hangout”