Compiling errors in my code!

 

I have a CList which holds trade objects (structs)

My struct looks like this:

struct trade {
   int ticketNumber;
   double stopLossLevel;
   truefalse isTrailing;
   fiblevels breakevenPoint;
   bool hasHitBreakeven;
   double distanceInPrice;
   double tp1;
   double closeAtTp;
};

truefalse is an enumerator

enum truefalse {
   enabled, //Enabled
   disabled, //Disabled
};

and so is fiblevels

enum fiblevels {
   full=0, //Entry Point
   twentythree=0.764, //Fibonacci 23.6
   thirtyeight=0.618, //Fibonacci 38.2
   half=0.5, //Fibonacci 50.0
   sixty=0.382, //Fibonacci 61.8
   none=1 //Do not use Breakeven
};

I iterate through this list of structs using 

for(int i = 0; i < trades.Total(); i++) {
      if(OrderSelect(trades.GetNodeAtIndex(i).ticketNumber, SELECT_BY_TICKET, MODE_TRADES) == false)
         continue;

but I am getting a compiler error saying Struct member undefined


I thought runtime polymorphism existed in MQL4 but am I wrong? Or have I went wrong somewhere here. Thanks

 
  1. You can't use floating point numbers in enumerators. Enumerators are integer only.
  2. The last element of an enumerator should not have an "," at the end
  3. Always compile with "#property strict" to force you to always write well structured code.
 
  1. Always post all relevant code (using Code button) or attach the file.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

    We have no idea what a trades is. What GetNodeAtIndex() returns.


  2. struct trade {
       int ticketNumber;
       double stopLossLevel;
       truefalse isTrailing; 
       fiblevels breakevenPoint;
       bool hasHitBreakeven;
       double distanceInPrice;
       double tp1;
       double closeAtTp;
    };
    Always declare largest to the smallest data types in order to minimize struct size. (Doubles/Datetimes/Strings, int/enumerations, bool last.)