@JMaxFx This is not the post for that, start a fresh question, and add a shared link on what you have already done
Posts made by jstap
-
RE: Close All MT5 trades quicklyposted in Tutorials by Users
-
RE: SCALING IN ON A PROFITABLE POSITIONposted in Questions & Answers
Various ways, but I would check the no of running trades,, depending on this number, I would activate a different pips away block
-
RE: SCALING IN ON A PROFITABLE POSITIONposted in Questions & Answers
If you want a group take profit add this option:

-
RE: Odd and Even Numbersposted in Questions & Answers
To make this a little dynamic in 1 condition Bloch, text code input MathMod(constant, 2) == 0
orange dot would be true and yellow dot would odd -
RE: Please add menu for Project "Save as"posted in Questions & Answers
It would be easier to have a copy function, but importing a copy only requires a couple of mouse clicks.
-
RE: SCALING IN ON A PROFITABLE POSITIONposted in Questions & Answers
To close all from TP - on trade tab - trade closed by TP - close all
Is this placing a trade every 30 pips?
-
RE: Close All MT5 trades quicklyposted in Tutorials by Users
@zentex74 To do this you can add a global variable, then in your EA modify the terminal variable with the magic number. I have not tested this but it should work.
On Tick Section
mql5
Copy code
startTime = GetMicrosecondCount(); // Record start time
sTrade.SetAsyncMode(true); // Enable asynchronous trade operationsClosePositionsByMagicNumber(magicNumberToClose); // Use the global variable for the magic number
PrintPerformance(startTime); // Monitor performance~next~
Global Variables/Includes Section
mql5
Copy code
#include <Trade/Trade.mqh>
ulong startTime; // To store the start time for performance measurement
CTrade sTrade; // Trade object used for operations
int magicNumberToClose = 12345; // Magic number for trades to close (change as needed)Custom Functions Section
mql5
Copy code
void ClosePositionsByMagicNumber(int magicNumber) {
for (int cnt = PositionsTotal() - 1; cnt >= 0 && !IsStopped(); cnt--) {
if (PositionSelectByIndex(cnt)) {
// Check if the position's magic number matches the desired one
if (PositionGetInteger(POSITION_MAGIC) == magicNumber) {
// Close the position
sTrade.PositionClose(PositionGetInteger(POSITION_TICKET), 100);
uint code = sTrade.ResultRetcode();
Print("Close result code: ", IntegerToString(code));
}
}
}
}void PrintPerformance(ulong startTime) {
for (int i = 0; i < 100; i++) {
Print("Elapsed time: ", IntegerToString(GetMicrosecondCount() - startTime), " microseconds. Open positions: ", IntegerToString(PositionsTotal()));
if (PositionsTotal() <= 0) { break; }
Sleep(100);
}
} -
RE: SCALING IN ON A PROFITABLE POSITIONposted in Questions & Answers
Add a shared link to see what you have done, and say what seems to not be working
-
RE: How to user Counter and Consecutive losses Box ?posted in Questions & Answers
Remove the AND block and connect in a row, connecting orange and yellow makes the block irrelevant because this says if true or false pass onto the next block
-
RE: Please how to find the day of monthposted in Questions & Answers
@l-andorrà Maybe I sometimes prefer to use custom because it gives me a direct reference to what is happening. I also didn't test that to see what happened.
-
RE: SCALING IN ON A PROFITABLE POSITIONposted in Questions & Answers
Pips away will do exactly what you are saying, because this can only be true if in profit. Choose 1 topic, and if you still struggle ask again there
-
RE: EA protection by license codeposted in Questions & Answers
Condition number == number if not terminate, this process can also be used to check account number
-
RE: Open Buy position at 15:55 Close Buy position at 09:40posted in Questions & Answers
2 trees, 1st tree once a day - open, 2nd tree once a day - close
-
RE: Please how to find the day of monthposted in Questions & Answers
Download and test that, in the comment on backtest you will see it displays the current day of the month number
-
RE: Please how to find the day of monthposted in Questions & Answers
You can get it like this: https://fxdreema.com/shared/9qnCuF8Pd condition block variable == 19 will give you the what you want
-
RE: SCALING IN ON A PROFITABLE POSITIONposted in Questions & Answers
Pink blocks, pips away - buy/sell
