Questions from Beginners MQL5 MT5 MetaTrader 5 - page 368

 

Good afternoon.

Can you tell me

if(OrderProfit()<=0)lot=OrderLots()*2;

How to add * to 2 in this line but not more than a certain number.

Thank you!

 
vulf:

Good afternoon.

Can you tell me

if(OrderProfit()<=0)lot=OrderLots()*2;

How to add * to 2 in this line but not more than a certain number.

Thank you!

If "but not more than a certain number" is a lot result, then add a check:

if(lot>"определенное число")
   lot="определенное число";

if not, try to explain in more detail.

 
Vladimir Belev:

if "but not more than a certain number" is a lot result, then add a check:

if not, try to explain in more detail.

the trading robot multiplies the previous order by 2 when an unprofitable trade appears.

Therefore, if N number of losing trades is accumulated, I would like to limit the maximum "certain number" to a prescribed lot.

Thank you.

 
vulf:

the trading robot multiplies the previous order by 2 when an unprofitable trade appears.

Accordingly, if N number of losing trades is accumulated, I would like to limit the maximum "certain number" to a prescribed lot.

Thank you.

So, the check will do (if I understand it correctly).

extern double maxlot=N;
...
...
...
 if(OrderProfit()<=0){lot=OrderLots()*2;if(lot>maxlot)lot=maxlot;}
 
Vladimir Belev:

So the check will do (if I understand correctly).

Thank you.

I'm trying to fit it in.

HOORAY !!! IT'S WORKING!!!! :)

Thank you so much!!!

 
Vladimir Belev:

Can you please tell me why a Stop order (without an expiry time set in the strategy tester) may be deleted (apart from the EA's actions)? I noticed that this happens at the moment when the price passes the level of an active order (i.e. conversion to buy/sell) - price slippage does not pass.

There is not enough money to open a market position with the lot in which the pending order is placed. The price reaches it --> there is not enough money --> the order is removed.

Check the log for records of insufficient funds.

 
Artyom Trishkin:

There is not enough money to open a market position with the lot the pending order is set at. The price reaches it --> there is not enough money --> the order is removed.

Check the log for records of insufficient funds.

Thank you. This is indeed the case(did a closer look). The log in the tester unfortunately didn't say anything, for some reason it doesn't show most of the events - placing orders, etc. is missing... although in the "results" tab everything is according to the chart.
 
Vladimir Belev:
Thank you. This is indeed true(did a closer look). Log in the tester unfortunately did not say anything, for some reason it does not show most of the events - placing orders, etc. disappears... Although everything is displayed in the "results" tab according to the chart.

The tester does not show everything in the log to speed up the test.

Click on the tester log and select View or Open. The second will open an explorer - there you select the file you want and open it in notepad, for example.

 
Hello, Can you help me with visibility of added custom signal in mql5 Wizard? I need a universal solution. Maybe a log can be written somewhere? Or where are the detailed requirements for the content from //--- wizard description start to //--- wizard description end? The problem is e.g. with the signal from here https://www.mql5.com/ru/code/842. (I've added ShortName=SuperTrend_, everything is compiled and lies where it should be) Other and my own signals are visible, but sometimes I have to hit an invisible wall. Thanks.
Модуль торговых сигналов, выполненный на основе индикатора SuperTrend
Модуль торговых сигналов, выполненный на основе индикатора SuperTrend
  • votes: 14
  • 2012.02.24
  • Nikolay Kositsin
  • www.mql5.com
Модуль торговых сигналов для Мастера MQL5. Сигналом для открытия позиций служит появление цветной точки индикатора SuperTrend.
 
newnek:
Hello! Please help me with the issue of visibility of added custom signal in mql5 wizard. I want a universal solution. Maybe the logs should be written somewhere? Or where are the detailed requirements for the content from //--- wizard description start to //--- wizard description end? The problem is e.g. with the signal from here https://www.mql5.com/ru/code/842. (I've added ShortName=SuperTrend_, everything is compiled and lies where it should be) Other and my own signals are visible, but sometimes I have to hit an invisible wall. Thanks.

The signal file is perfectly located in the MQL Wizard:

1