Questions from Beginners MQL5 MT5 MetaTrader 5 - page 489

 
Boris:
.... Throw the required indicators on the chart and continue testing....

How do you do it? The answer is probably obvious, but it's not working for me.

In general, you need to visualize exactly those buffers that are calculated in the EA, because:

1. it's easier to debug them

2. the Expert Advisor, depending on its state (whether a deal is opened or not), calculates the indicator with different parameters, but in the same buffer. As a result, the values will be different from the same indicator just thrown on the chart.

 
Shepot:

How do you do it? The answer is probably obvious, but it's not working for me.

In general, you need to visualize exactly those buffers that are calculated in the EA, because:

1. it's easier to debug them

2. the Expert Advisor, depending on its state (whether a deal is opened or not), calculates the indicator with different parameters, but in the same buffer. As a result, the values will be different from the same indicator, just thrown on the chart.

Display lines of the indicator on the chart of the visualization objects OBJ_TREND from the Expert Advisor according to the calculated in the Expert Advisor data of the past bar and the current one.
 
Artyom Trishkin:
Display the indicator lines on the chart by OBJ_TREND objects from the EA according to the data calculated in the EA for the last bar and the current bar.
Thank you. I have already thought about such a solution, but it has a disadvantage: performance leaves much to be desired, especially as I have 3 built-in indicators. Maybe there are other ways?
 
Shepot:
Thank you. I've already thought of such a solution, but it has a disadvantage: the performance leaves a lot to be desired, especially since I have 3 built-in indicators. Maybe there are other ways?
Output the lines at the opening of the minute bar and at the recalculation of indicator values.
 
Shepot:
Thank you. I have already thought about such a solution, but it has a disadvantage: performance leaves much to be desired, especially since I have 3 built-in indicators. Maybe there are other ways?

1. Put the required indicators with the appropriate parameters on the chart, save the template with the EA name or under the name "tester" and then when you start the EA in visualisation mode, all the required indicators will be visible on the chart.

2. The indicator values can be drawn in the Comment() but this slows down the testing as well as the chart objects.

 
Thank you all so much!
 
Can't understand what the terminal log message means : 2015.12.28 18:30:39.718 '1656096': order #0 buy 0.00 at 0 was modified -> sl: 0 tp: 0

 
Petr_k:
I can't understand what the terminal log message means : 2015.12.28 18:30:39.718 '1656096': order #0 buy 0.00 at 0 was modified -> sl: 0 tp: 0

order #0 buy at 0 at 0.00 was modified -> set sl: 0 tp: 0
 

Hi.

There is a confusing situation with the deviation tolerance during testing.

1) I set deviation =10 points

mytrade.SetDeviationInPoints(dev);
mytrade.SetTypeFilling(ORDER_FILLING_RETURN);

2) Running

mytrade.PositionOpen(_Symbol,ORDER_TYPE_BUY,Lot,lastprice,lastprice-SL,lastprice+TP,"Test Buy");

or

mytrade.Buy(Lot,_Symbol,0.0,lastprice-SL,lastprice+TP,"Buy Trade");

It doesn't matter if I put lastprice, or signal price, or just 0.

3) I do the test

а)

Print("Разница: ",mytrade.ResultPrice()-цена сигнала);

I get 20, which is more than 10

б)

QL      0       08:57:35.302    Фракталы - неск,ТС,% (Si Splice,M5)     2015.01.29 14:15:32   ---===Транзакция===---
QH      0       08:57:35.302    Фракталы - неск,ТС,% (Si Splice,M5)     2015.01.29 14:15:32   Тип сделки: DEAL_TYPE_BUY
RN      0       08:57:35.302    Фракталы - неск,ТС,% (Si Splice,M5)     2015.01.29 14:15:32   Состояние ордера: ORDER_STATE_STARTED
QO      0       08:57:35.302    Фракталы - неск,ТС,% (Si Splice,M5)     2015.01.29 14:15:32   Тип ордера: ORDER_TYPE_BUY
CS      0       08:57:35.302    Фракталы - неск,ТС,% (Si Splice,M5)     2015.01.29 14:15:32   Цена: 70885
PS      0       08:57:35.302    Фракталы - неск,ТС,% (Si Splice,M5)     2015.01.29 14:15:32   Тип торговой транзакции: TRADE_TRANSACTION_DEAL_ADD

request.deviation

LM	0	08:57:35.303	Фракталы - неск,ТС,% (Si Splice,M5)	2015.01.29 14:15:32   Отклонение от запрашиваемой цены: 1

I get the price from MqlTradeTransaction - after the signal (70865), ctrade buys for 70885.

в)

Print(mytrade.RequestDeviation());

= 10.

What could be the problem? Of course, we can watch the last trade or offer in the stack, but based on the first results in the real, it's all unreliable.

Or put a limit order price+10 and remove it after some time.

 
In general, I have settled on a limit bid price+rebate for a few seconds. On Forts the equivalent of the market price will be obtained, and the execution price will not go higher 100%.
Reason: