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

My shell EA code
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=79
Page 10 of 23
Author:  SteveHopwood [ Mon Sep 10, 2012 12:43 pm ]
Post subject:  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.

:D
Author:  NeoTrader [ Mon Sep 10, 2012 1:56 pm ]
Post subject:  Re: My shell EA code

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

-
Author:  FreddyFX [ Sun Sep 30, 2012 3:28 pm ]
Post subject:  Re: My shell EA code

Starting my first steps in the coding field, keeping that in mind !!!
Author:  SteveHopwood [ Sun Sep 30, 2012 5:26 pm ]
Post subject:  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.

:D
Author:  Carioca [ Mon Oct 08, 2012 5:17 pm ]
Post subject:  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
Author:  SteveHopwood [ Mon Oct 08, 2012 5:36 pm ]
Post subject:  Re: My shell EA code

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
Author:  cuzgeorge [ Mon Oct 08, 2012 5:40 pm ]
Post subject:  Re: My shell EA code

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.
Author:  gaheitman [ Fri Oct 19, 2012 3:26 pm ]
Post subject:  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:

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
Author:  SteveHopwood [ Fri Oct 19, 2012 4:53 pm ]
Post subject:  Re: Demo Trading Only

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
Author:  gaheitman [ Fri Oct 19, 2012 5:11 pm ]
Post subject:  Re: Demo Trading Only

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
All times are UTC Page 10 of 23