My EA is firing off multiple trades instead of 1 per candle. - page 2

 
Vladimir Karputov #:

Because when I compile it it gives me no errors, i simply don't know where to look for bugs.


Kindly see attached screenshot Output.

 

I repeat for the third time: Your code does not compile because the following error is thrown:

can't open "C:\Users\barab\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Include\LotSizeCalc.mqh" include file      1.mq5   7       11


++ Hint: You need to attach the missing file

 
Vladimir Karputov #:

I repeat for the third time: Your code does not compile because the following error is thrown:

I understand what u are saying, but it seems that u refuse to even listen to what I am saying, talkless of understanding it.

I would assume that u are the more advanced/experienced one here out of the two of us.

It boils down to this?

How can I fix it? U keep telling me your errors when u compile, but wont tell me or give me any idea on how to fix it, despite the fact that I told u multiple times, that the same code compiles fine on my PC.

How am I supposed to fix it, if it doesn't show me any errors?  Where do i even begin?

I even responded based on your error, and told you where the include file is located on my PC. "Its inside the Include folder", I checked and double-checked and triple-checked.

Why do u keep repeating a point I have no idea how to deal with, despite me saying I have no idea how to deal with it?

Am i making any sense here for the love of GOD? 

 
Vladimir Karputov #:

I repeat for the third time: Your code does not compile because the following error is thrown:


++ Hint: You need to attach the missing file

Wow, who knew that a tiny hint could have saved me from a mini rant. 

Kindly see attached.

Files:
 

You need to control the process of execution of a trading order.

Or a simpler option: check the signal ONLY at the moment of the birth of a new bar.

 

And yet - you need to learn how to use the tester and debugging. Set breakpoints and (using the right mouse button) keep track of the 'myLotSize' variable:

 
Vladimir Karputov #:

And yet - you need to learn how to use the tester and debugging. Set breakpoints and (using the right mouse button) keep track of the 'myLotSize' variable:

Ok, thanks for the help. I definitely haven't used break points as u mentioned, and could sure get to know more about the tester and debugging routines. Ill keep at it now.

 
tradingwisely #: Just to clarify shall I move all of these to the OnInit Function?

Don't try to use any price (or indicator) or server related functions in OnInit (or on load or in OnTimer before you've received a tick), 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. A new tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
Reason: