Errors, bugs, questions - page 3185

 

Hi,

I've used an EA on mt4 demo account previously. Now I've converted over to a live account and linked a broker to it. However, when I go to place a trade either manually or with EA nothing happens. I have the smiley face to show me the EA is on and running but still no trade is made. If I try to place a trade myself then the trade window which should have the market information as well as the symbol, volume and value are all blank. Can someone please help me identify what is wrong?

Thank you.

 
Scott Evans #:

Hi,

I've used an EA on mt4 demo account previously. Now I've converted over to a live account and linked a broker to it. However, when I go to place a trade either manually or with EA nothing happens. I have the smiley face to show me the EA is on and running but still no trade is made. If I try to place a trade myself then the trade window which should have the market information as well as the symbol, volume and value are all blank. Can someone please help me identify what is wrong?

Thank you.

Contact the author/seller for help and support.

 
I've contacted the author and he has told me to remove, refresh and then reinsert the EA. I have carried that out and still the problem remains. I'll attache some screenshots to maybe explain my situation better.
 
Scott Evans #:
I've contacted the author and he has told me to remove, refresh and then reinsert the EA. I have carried that out and still the problem remains. I'll attache some screenshots to maybe explain my situation better.

Can't you see the message?

Trade is disabled in your account in general, contact your broker.

 

Can't figure out "wrong parameters count" compiler error for struct's constructor when returning a struct

I really can't figure out this compiler error:

why does uncommenting the no parameter constructor solve the problem? 

and will my code run correctly? I mean will the parameterized constructor get called on the return line?

struct Stats {
   // Constructors
   //Stats() {}; // if I uncomment this it compiles and error goes away
   Stats(const double aLeeway);

}

Stats::Stats(const double aLeeway) :
        _leeway(aLeeway) {}        


Stats Foo::stats() const {
   return Stats(_leeway); // error: wrong parameters count - note: _leeeway is a double member variable of Foo
}
 
The Basics of Object-Oriented Programming
The Basics of Object-Oriented Programming
  • www.mql5.com
You don't need to know what are polymorphism, encapsulation, etc. all about in to use object-oriented programming (OOP)... you may simply use these features. This article covers the basics of OOP with hands-on examples.
 
I had a look, I still don't know what I'm doing wrong... do classes always have to have a constructor that has no parameters even if you make a constructor that has parameters?
 
ycomp #: I really can't figure out this compiler error:
  1. Do not post code that will not even compile. Your Stats constructor references a non-existing _leeway.

  2. We have no idea what Foo is.
              Be precise and informative about your problem

  3. Your return looks like a cast. You might try:

    Stats tmp(_leeway); return tmp;

  4. ycomp # do classes always have to have a constructor that has no parameters 

    No.

 

MQL5 Help File: NormalizeDouble

Rounding floating point number to a specified accuracy.

double  NormalizeDouble(
   double  value,      // normalized number
   int     digits      // number of digits after decimal point
   );

the comment for value seems to be a typo, just letting whoever edits these things know

 

let's say I'm going to do about 20+ StringAdd() calls and with most of those calling IntegerToString() or DoubleToString() before passing the string to StringAdd() and also 20+ StringAdd() calls to add a "\n"

the goal is to make one big string here with all the data on separate lines.

would that probably be faster or slower than just using one big StringFormat() call to create a string from all of those values?

I have chosen not to consider StringConcatenate at all because I'm trying to make my code compatible with both MQL4 and 5 and the syntax is different and because they are variadic functions I can't spin my own function to call them, and I would rather keep the actual calls that pass the data the same for both mql4 and 5 since I have a lot of them.

also, did StringAdd for MQL4 & 5 use to have different syntaxes? because I see it mentioned in an article on the MQL5 site about migrating from MQL4 to 5 but I can't see any difference in syntax or description in the docs for the MQL4 StringAdd() and the MQL5 StringAdd()
Reason: