Posts made by jstap
-
RE: Each closed position filterposted in Questions & Answers
It looks like it shouldn't, hard to say from a picture, add a shared link and maybe the fault can be seen
-
RE: Moving average opening too much buysposted in Questions & Answers
It's because you have an if trade block connected to your buy blocks
-
RE: paraboric sar crosses above candle issueposted in Questions & Answers
Explain a little more on what you need. For example PSAR is < candle 1 close and PSAR is > candle 0 close will open a sell as soon as the dot moves from below to above.
-
RE: PLS help in adding Fibonacci money management to DCAposted in Questions & Answers
Tell me how fib money management works, maybe I can help you
-
RE: Convert MT4 to MT5 or build from MT5?posted in General Discussions
Create a fresh version, you can convert but blocks that have position in them are MT5, so any blocks created on MT4 without need replacing.
-
RE: TRENDLINE BREAKOUT EAposted in Questions & Answers
If there is nothing under indicator is visible then it will do nothing, the orange dot passes information on if block is true
-
RE: MT5 Close All Fastposted in Questions & Answers
Custom function is not global variables, there 1/2 way down on the right side, there are 3 sections and there all labelled on tick (for this) is the top section, custom functions is on the right, global variables is on the bottom
-
RE: Calculated lot size in comment on chart before openposted in Questions & Answers
@MT4Nutzer This is possible, Roar showed me ths a long time ago, it is about getting the code from the MQ file, changing it slightly, then displaying on chart. Not a trivial thing to do, and I am unsure where to start.
-
RE: Adjusting TP to Include Commission in a Manual Trading Botposted in Questions & Answers
Addt to a project and place a shared link to look at, Ill see what's right/wrong from there
-
RE: MT5 Close All Fastposted in Questions & Answers
You will have to create 2 blocks, 1 to close buys, and 1 for sells, haven't tested but should work.
Buys:
// On tick section:
startTime = GetMicrosecondCount(); // Record start time
sTrade.SetAsyncMode(true); // Enable asynchronous trade operationsCloseBuyPositions(); // Call function to close only buy positions
PrintPerformance(startTime); // Monitor performance// Global variables section:
#include <Trade/Trade.mqh>
ulong startTime; // To store the start time for performance measurement
CTrade sTrade; // Trade object used for operations// Custom function section:
void CloseBuyPositions() {
for (int cnt = PositionsTotal() - 1; cnt >= 0 && !IsStopped(); cnt--) {
ulong ticket = PositionGetTicket(cnt);
if (ticket > 0) {
// Check if the position is a BUY
if (PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY) {
sTrade.PositionClose(ticket, 100);
uint code = sTrade.ResultRetcode();
Print("Close BUY 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);
}
}Sells:
// On tick section:
startTime = GetMicrosecondCount(); // Record start time
sTrade.SetAsyncMode(true); // Enable asynchronous trade operationsCloseSellPositions(); // Call function to close only sell positions
PrintPerformance(startTime); // Monitor performance// Global variables section:
#include <Trade/Trade.mqh>
ulong startTime; // To store the start time for performance measurement
CTrade sTrade; // Trade object used for operations// Custom function section:
void CloseSellPositions() {
for (int cnt = PositionsTotal() - 1; cnt >= 0 && !IsStopped(); cnt--) {
ulong ticket = PositionGetTicket(cnt);
if (ticket > 0) {
// Check if the position is a SELL
if (PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL) {
sTrade.PositionClose(ticket, 100);
uint code = sTrade.ResultRetcode();
Print("Close SELL 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: WHAT IS THE DIFFERENCE BETWEEN : CUSTOM (PRICE LEVEL) AND CUSTOM (PRICE FRACTION)posted in Questions & Answers
level is the price (as seen on the right of your chart), fraction is the distance of 2 of these levels
-
RE: Adjusting TP to Include Commission in a Manual Trading Botposted in Questions & Answers
You can't add candle price to spread (level - fraction (distance)). You can try candle price + 0 (in adjust put, SymbolInfoInteger(NULL, SYMBOL_SPREAD)
Let me know if it works
