Hello, i'm programming a trading robot, i have this concern, HELP ME!!:)

To add comments, please log in or register
Raúl Rodrígues
57
Raúl Rodrígues  
   double operacion = EURUSDPIPS();


void OnTick(){
              if (operacion =<20){
              double arriesgue = AccountInfoDouble(ACCOUNT_BALANCE)*.05;
              Print("trade is an executable one");
}

//It has an error, actuaally it's telling me this: '<' - operand expected//
kypa
972
kypa  
<=
Antonio Simon Del Vecchio
614
Antonio Simon Del Vecchio  
if (operacion <=20) \\Not =<
Minions Labs
1096
Minions Labs  
Raúl Rodrígues:

Please don't try to fool people to open your post with a Title like that. It is childish.

Even if you manage to complete your "trading robot" it will be huge and bloated. You have the worst 5-line MQL code of all times. I urge you to first, learn how to code in MQL5.

  1. The IF line tells me that you don't even have a background in any serious programming language. The standard Comparison operator is ">=", not "=<".
  2. On every single tick on the platform you are instantiating again, and again, and again, the variable "arriesgue".
  3. Worst than that you are calling in this very same way AccountInfoDouble().
  4. And, the same goes for the Print()...
whroeder1
17945
whroeder1  
And the variable operacion is set only on EA load. It never updates and is likely invalid:
Don't try to use any price or server related functions in OnInit (or on load,) as there may be no connection/chart yet:
  1. Terminal starts.
  2. Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
  3. OnInit is called.
  4. For indicators OnCalculate is called with any existing history.
  5. Human may have to enter password, connection to server begins.
  6. New history is received, OnCalculate called again.
  7. New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
Keith Watford
Moderator
13915
Keith Watford  

I have edited your title as it is a blatant attempt to get people to contact you. I will also edit the title in your other topic.

Don't make false claims as it is obvious from your lack of coding experience that your title was untrue.

To add comments, please log in or register