Here: https://fxdreema.com/shared/jXni7Yt3b
You put a few blocks for counting the position in On Trade only (elsewhere it will be inefficient) and store the open trades count in a variable. Then you can check this variable against your limit.
Best posts made by catequil
-
RE: Maximum number of trades openposted in Questions & Answers
-
Re: [Array out of range at OnTradeDetector()](/forum/topic/6892/array-out-of-range-at-ontradedetector)posted in Bug Reports
Re: Array out of range at OnTradeDetector()
I have had the same problem as yours. My workaround is to delete the whole "if" block where this problem appears. It works for me since I am not using anyway the functionalities that are included in it:
"Position reversed", "Position modified SL and/or TP" and "Check position increment/decrement".
I delete the lines
starting from "if ((lastPositionsTotal == positions_total) && (lastOrdersTotal == orders_total))"
down to (but not including) "BuildPositionsList(EGV_PositionsList0);".It would be very nice, if the Admin fixes the issue, so that we don't have to manually edit the code and use the stock MetaEditor, as (this is my other problem) the stock MetaEditor almost doubles the size of the .mql5 file when compiling. Strangely the FXdreema compiler produces almost equal .mql5 and .ex5 size files...