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...
Latest posts made by catequil
-
RE: EQUIDISTANT PENDING ORDERSposted in Questions & Answers
This should work (haven't tried it): https://fxdreema.com/shared/LsGwrcCnb
You create a buy order with its 10 pips stop. Should the buy order get stopped out, you detect it in "OnTrade" and place a pending buy order with an offset of +10 pips (this should make it a pending buy stop). -
RE: Arranging input parameters in an EAposted in Questions & Answers
This is a question or rather a request to the admin.

Perhaps it is possible the input variables screen to accept the keyword "group" as a data type and a string value in the value field without needing a variable in the variable field and then transfer it to the code as is.
I.e.:
input group "General settings" -
RE: Maximum number of trades openposted in Questions & Answers
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. -
RE: PLS HOW CAN I MAKE MY STOP LOSS TO DYNAMICALLY MOVE TO THE CANDLE ID 2 LOW EACH TIME A NEW CANDLE CLOSES.posted in Questions & Answers
Hi,
I guess you are talking of a sell stop on a long position. It will be difficult to do it on the close of a candle, but very easy to do it right after i.e. on the open of a new candle. Pls, see https://fxdreema.com/shared/BP9Z32Zzd
you should have in mind that the new candle has the ID 0 and you count starting from that... -
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...
-
Arranging input parameters in an EAposted in Questions & Answers
Hello, everyone.
Is it possible to implement in FXDreema the "group" keyword for arranging input parameters in folders?
From MQL reference book:"For the convenience of working with MQL5 programs, the input parameters can be divided into named blocks using the group keyword. This allows for visual separation of some parameters from others based on the logic embedded in them.
input group "Group name"
"
I do it manually every time and have to recompile by the Metaeditor compilator. There would be no problem with that (except for the extra efforts), but I noticed that when I recompile the .ex5 through MetaEditor it becomes twice as large than the .mql5 file, whilst when FXdreema compiles it both the ex5 and mql5 files are close in sizes. -
Request/suggestion for "Close partially (group of trades)" blockposted in Questions & Answers
Hi, fxDreema,
I would like to request/suggest, if not too much of a trouble, the creation of a block "Close partially (group of trades)".
The idea is that it will be a more precise partial close (with regard to the total position) than partially closing each trade and the rounding effects the current process has.
Example:
we are long
0.01
0.01
0.01
or total long of 0.03 lots.If we need to close 67% of that position and we use "close (partially)" block, the EA will close:
0.01 of 0.01
0.01 of 0.01
0.01 of 0.01
i.e. all the position will be closed out, instead of the needed 0.02 lots out of 0.03.The new block could start closing out positions one by one starting from the oldest/ or newest/ or most profitable/ or least profitable until it reaches the desired level.
Thanks in advance
-
"Buy now" block doesn't execute when TP and/or SL mode are set to "no"posted in Bug Reports
But when set to certain amount of fixed pips, it seems to work.
-
RE: EA Optimization pass result is different when I backtest itposted in Questions & Answers
Avoid optimising in 1min OHLC when it is an relatively HFT strategy.
-
RE: Terminate other EAsposted in Questions & Answers
Just an idea: you can assign a value (representing an EA individual number) to a terminal variable. This terminal variable is being read by all EA's in 'on tick'. If an EA sees its own number, then it stops.