Questions from Beginners MQL5 MT5 MetaTrader 5 - page 45

 

Please advise.

How to increase trawl step.

Frequently accessing the server trawls every pips.

I need 50 or 100 pips on five digits.


// +-------------------------------------------------------------------------+
// checkTrailingStop function|
// +-------------------------------------------------------------------------+
void checkTrailingStop( int iiPos ) {

// check Trailing Stop and set it to follow the price

double ldblCurrentPrice;
double ldblCurrentSL;
double ldblNewStopLoss;
double ldblSymbolPoint;
long llDigits;
int liDigits;

MqlTradeRequest mqlTradeRequest = { 0 };
MqlTradeResult mqlTradeResult = { 0 };
MqlTradeCheckResult mqlTradeCheckResult = { 0 };

if ( STOPLOSS <= 0 ) {
return;
}

// if there is no open position leave the routine
if ( !PositionSelect( gSymbol[iiPos].gstrSymbol ) {
return;
}

ldblSymbolPoint = SymbolInfoDouble( gSymbol[iiPos].gstrSymbol, SYMBOL_POINT );

ldblCurrentSL = PositionGetDouble( POSITION_SL );

if ( PositionGetInteger ( POSITION_TYPE ) == POSITION_TYPE_SELL ) {
ldblCurrentPrice = SymbolInfoDouble( gSymbol[iiPos].gstrSymbol, SYMBOL_BID );
ldblNewStopLoss = ldblCurrentPrice + STOPLOSS * ldblSymbolPoint;
if ( ldblCurrentSL <= ldblNewStopLoss ) {
return;
}
} else {
ldblCurrentPrice = SymbolInfoDouble( gSymbol[iiPos].gstrSymbol, SYMBOL_ASK );
ldblNewStopLoss = ldblCurrentPrice - STOPLOSS * ldblSymbolPoint;
if ( ldblCurrentSL >= ldblNewStopLoss ) {
return;

Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура результатов проверки торгового запроса
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура результатов проверки торгового запроса
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура результатов проверки торгового запроса - Документация по MQL5
 
Philin: Some tips on how to increase trawl step. The server is often accessed by trawling every one pip. I need it in 50 or 100 pips on five digits.

1. Insert the code correctly (Ctrl+Alt+M).

2. These lines seem to be responsible for triggering the "trawl":

   if(ldblCurrentSL<=ldblNewStopLoss)
     {
      return;
     }
   if(ldblCurrentSL>=ldblNewStopLoss)
     {
      return;
     }

In case of POSITION_TYPE_SELL the "trawl" is triggered if condition 'ldblCurrentSL<=ldblNewStopLoss' is not fulfilled. Try to change it like this:

   if(ldblCurrentSL-50*_Point<=ldblNewStopLoss) return;

And by analogy, for buying.

 
Yedelkin:

1. Insert the code correctly (Ctrl+Alt+M).

2. These lines seem to be responsible for triggering the "trawl":

In case of POSITION_TYPE_SELL the "trawl" is triggered if line 'ldblCurrentSL<=ldblNewStopLoss' is not executed. Try to change it like this:

Well, and by analogy, for buying.

Thank you very much I will try it.

 

Please help me run this:https://www.mql5.com/ru/code/268

I tried to use Wizard to build an EA, but in the list of signals there is no"Signals based on reversal candlestick patterns", as written in the description

I tried to load it completely from codebase into metatrader, expert advisor appeared and I tried to test it on EUR/USD H1 with default parameters but it wouldn't open any order

Мастер MQL5 - Торговые сигналы по факту формирования "разворотной" свечной модели
Мастер MQL5 - Торговые сигналы по факту формирования "разворотной" свечной модели
  • votes: 7
  • 2011.01.19
  • MetaQuotes Software Corp.
  • www.mql5.com
Торговые сигналы по факту формирования "разворотной" свечной модели "Signals based on reversal candlestick patterns" (класс CSignalCandles из Стандартной библиотеки).
 
Philin:

For more versatility, you can put ldblSymbolPoint instead of _Point:

if(ldblCurrentSL-50*ldblSymbolPoint<=ldblNewStopLoss) return;
 
Dimka-novitsek: in what form is it best to transfer the EA from computer to computer? How can it be packed into a file?
You need to open the folder where your Expert Advisors are stored(like MQL5/Experts) on the 1st computer, copy the necessary file (eg, myExpert.mq5) and paste this file into the same folder on the second computer. Then compile it.
 

What is the Users folder, please? It's 76.3% of the C volume at !!!!!!!. And I don't see it listed at all... What a rage! What's in there?

4.94 GB free on the C drive out of 197.9 GB !!! And as if the biggest brother wouldn't tell us that these are our platforms... He's got the most tanks and monsters in the world.

 
Dimka-novitsek: Tell me please, what is the Users folder? It's 76.3% of the C drive volume at !!!!!!!. I don't see it listed at all... What a rage!!! What's in there?

4.94 GB free on the C drive out of 197.9 GB !!! And as if the biggest brother didn't say it's our platforms... He has the most tanks and monsters.

These questions are hardly relevant to the subject matter of this forum.
 
Thank you!
 

When testing in the tester a critical error OnTick() zero divide by 0.

How to find this very spot in a big Expert Advisor? Is it possible to use notepad?

Документация по MQL5: Программы MQL5 / Ошибки выполнения
Документация по MQL5: Программы MQL5 / Ошибки выполнения
  • www.mql5.com
Программы MQL5 / Ошибки выполнения - Документация по MQL5
Reason: