Download MetaTrader 5
To add comments, please log in or register
How to buy a product in MetaTrader AppStore? Read the article!
alexbau
8
alexbau 2016.05.01 21:04 

Friends, hello.

 

I wish someone could help me.

I create the expert advisor in the file below.

But I would like the expert advisor to execute only one order per bar.

Can anyone help me with the code and where in the expert advisor I put these codes? 

Files:
Doerk Hilger
1073
Doerk Hilger 2016.05.02 05:42  

... 

static datetime tlastbar=0;

datetime tnewbar=iTime(NULL,PERIOD_CURRENT,0);

bool isnewbar=tnewbar!=tlastbar;

tlastbar=tnewbar; 

if (!newbar)

   return;

Fernando Carreiro
1502
Fernando Carreiro 2016.05.02 07:43  
@Doerk: Your heart is obviously in the right place, but unfortunately I don't think the OP is going to be able to use your code because he is using a Code Generator. He does not seem to know how to code in MQL4 at all, so I guess he will just have to follow one of those 3 options that WHRoeder usually lists (ie. To either Learn It, Search for It or Hire someone to Code it for him).
Doerk Hilger
1073
Doerk Hilger 2016.05.02 14:10  
FMIC:
@Doerk: Your heart is obviously in the right place, but unfortunately I don't think the OP is going to be able to use your code because he is using a Code Generator. He does not seem to know how to code in MQL4 at all, so I guess he will just have to follow one of those 3 options that WHRoeder usually lists (ie. To either Learn It, Search for It or Hire someone to Code it for him).
Didnt recognize the code builder immediately. It was just copy and paste during a cup of coffee during a break on the terrace :) But I agree totally with the opinion about code generators. 
whroeder1
13627
whroeder1 2016.05.02 16:49  
  • We hate EA builder
  • You couldn't be bothered to learn mql4, therefor there is no common language for us to communicate.
  • There are only two choices: learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem, but we are not going to debug your hundreds lines of code.
  • EA builder makes bad code counting up while closing multiple orders.
  • EA builder makes bad code Bars is unreliable (max bars on chart) volume is unreliable (miss ticks) Always use time
  • EA builder makes bad code Not adjusting for 4/5 digit brokers
  • EA builder makes bad code not adjusting for ECN brokers.
  • EA builder makes bad code not checking return codes.
  • EATree uses objects on chart to save values - not persistent storage (files or GV+Flush.) No recovery (crash/reboot.)
/
To add comments, please log in or register