Bt2, you really tried in bring down the errors to just 4 warnings.
The maxorder seem not to be working. When I ran your edited version it still opened more than 3 orders per pair I specified in the maxorder. What I want is for the ea to open a specified number of x orders per pair rather than opening 12 or more orders per pair.
As for the 4 functions warnings maybe the attached ea might be of help. That is where I copied from the functions and hedging codes I pasted in the ea. Can you please take a look at it and see what I did wrong.
Once again, thanks for your efforts.