Stop Loss, Take Profit and Trailing are disabled. When opening a position, a comment ("UP" or "DOWN") is added, to understand which line has triggered the signal.
OnTick will show a critical error when going through any line.
MJ 002:48:40.746 Tester EURUSD,H1 (Alpari-MT5-Demo): generating based on real ticks
JR 002:48:40.746 Tester EURUSD,H1: testing of Experts\Two_Trend_Line.ex5 from2019.08.0100:00 to 2019.08.1900:00 started with inputs:
KR 002:48:40.746 Tester InpStopLoss=0
QF 002:48:40.746 Tester InpTakeProfit=0
PL 002:48:40.746 Tester InpTrailingFrequency=9
IN 002:48:40.746 Tester InpTrailingStop=0
PD 002:48:40.746 Tester InpTrailingStep=5
IR 002:48:40.746 Tester InpLotOrRisk=1
NQ 002:48:40.746 Tester InpVolumeLotOrRisk=0.01
MG 002:48:40.746 Tester InpTrendLineUPName=UP
MP 002:48:40.746 Tester InpTrendLineDOWNName=DOWN
IF 002:48:40.746 Tester InpWorkTimeFrame=0
RL 002:48:40.746 Tester InpOnlyOne=false
DQ 002:48:40.746 Tester InpReverse=false
IE 002:48:40.746 Tester InpCloseOpposite=false
LQ 002:48:40.746 Tester InpPrintLog=false
IF 002:48:40.746 Tester InpMagicUP=312169352
EF 002:48:40.746 Tester InpMagicDOWN=312169353
MO 002:48:40.953 Ticks EURUSD : real ticks begin from2019.08.0100:00:00
OI 002:48:41.164 History EURUSD,Daily: history cache allocated for423 bars and contains 410 bars from2018.01.0200:00 to 2019.07.3100:00
DK 002:48:41.183 History EURUSD,Daily: history begins from2018.01.0200:00
CK 202:49:07.469 Two_Trend_Line (EURUSD,H1) 2019.08.0104:00:00 array out of range in'Two_Trend_Line.mq5' (1302,69)
RE 202:49:07.469 Tester OnTick critical error
IK 002:49:07.475 Tester EURUSD,H1: 10397 ticks, 5 bars generated. Environment synchronized in0:00:00.568. Test passed in0:00:26.980 (including ticks preprocessing 0:00:00.172).
FN 002:49:07.475 Tester EURUSD,H1: total time from login to stop testing 0:00:27.548 (including 0:00:00.568for history data synchronization)
HR 002:49:07.476 Tester 274 Mb memory used including 1.41 Mb of history data, 64 Mb of tick data
A mistake somewhere in the choice of money management. When we switch from interest to fixed lot. When interest is left, positions are opened. Apparently I'm just in a hurry. Another thing: positions open with a lag. Of course, maybe that's how it's supposed to be for now. I'm not racing the horses. I'm just coordinating the course of events. I'm sorry. if I should have reported the Bid and Ask earlier. The trades should come from them, not the candlesticks.
In the first case, the bot waited for the next candle and opened a Sell immediately with it. But it should have been done as soon as Ask has crossed the Down line from above downwards. The same story with the UP line. When making transactions, the bot should start from the current market price (Ask and Bid), but not from the candlesticks. The algorithm is as follows: If Ask < the Up or Down line, then SELL. If Bid > the Up or Down line, then BUY. Bid and Ask are not meant in terms of trading, but in terms of condition. Both indicators must cross the line. As soon as it happened, a trade is executed. Opening andclosing of positions should be based on the current price, and not on the OPN and CLSE candlesticks.
Remind you: Checking the crossover works ONLY at the moment when a new bar is born. Reacting instantly to price crossing is quite dangerous and I don't see the logic in it.
Added:
pay attention to the"Work Time Frame" parameter - this is the one that sets the timeframe at which the new bar is caught. And already on the new bar of the "Work Time Frame" timeframe checks the crossing of price on H1. That is, if the"Work Time Frame" is set to M1, it means that crossing of our lines by the H1 bar will be checked once a minute.
Remind you: Checking the crossover works ONLY at the moment when a new bar is born. Reacting instantly to price crossing is quite dangerous and I don't see the logic in it.
Added:
pay attention to the"Work Time Frame" parameter - this is the one that sets the timeframe at which the new bar is caught. And already on the new bar of the "Work Time Frame" timeframe checks the crossing of price on H1. That is, if the"Work Time Frame" is set to M1, it means that crossing of our lines by the H1 bar will be checked once a minute.
As an option: to take the check to a faster timeframe, yes. But I would like it to be on Ask and Bid. The trades will be frequent, of course. We will see. Maybe on bars with M1 and even better.
Rad89: Problem. UP line is crossed, but SELL trade is hanging on. In the settings I set M1
Full set file with settings please. Template of the chart in the plotted lines. Dates from and to. Symbol and timeframe. Generally two tabs (Natstrokes and Parameters) from the Tester window.
Full set file with settings please. Chart template with lines drawn. Dates from and to. Symbol and timeframe. Generally two tabs (Natstrokes and Parameters) from the Tester window.
There is no problem with lines. Put them anywhere on the chart and they are automatically put where they should be on the new day. It's with them that everything is clear, all right. The problem is in the lag of working with orders. I have not changed anything in settings other than timeframe and lot. I have called the lines as they should be. Everything is OK with lines. They fit on the chart like clockwork.
Full set file with settings please. Chart template with lines drawn. Dates from and to. Symbol and timeframe. Generally two tabs (Natstrokes and Parameters) from the Tester window.
I will only be able to record a video in the evening, if not decided by that time. I will directly show the points where the bot misses.
Two Trend Line.mq5
version "1.001"
Stop Loss, Take Profit and Trailing are disabled. When opening a position, a comment ("UP" or "DOWN") is added, to understand which line has triggered the signal.
OnTick will show a critical error when going through any line.
A mistake somewhere in the choice of money management. When we switch from interest to fixed lot. When interest is left, positions are opened. Apparently I'm just in a hurry. Another thing: positions open with a lag.
Of course, maybe that's how it's supposed to be for now. I'm not racing the horses. I'm just coordinating the course of events.
I'm sorry. if I should have reported the Bid and Ask earlier. The trades should come from them, not the candlesticks.
In the first case, the bot waited for the next candle and opened a Sell immediately with it. But it should have been done as soon as Ask has crossed the Down line from above downwards. The same story with the UP line. When making transactions, the bot should start from the current market price (Ask and Bid), but not from the candlesticks.
The algorithm is as follows: If Ask < the Up or Down line, then SELL. If Bid > the Up or Down line, then BUY. Bid and Ask are not meant in terms of trading, but in terms of condition. Both indicators must cross the line. As soon as it happened, a trade is executed. Opening andclosing of positions should be based on the current price, and not on the OPN and CLSE candlesticks.
Two Trend Line.mq5
version "1.002"
Fixed working with risk when setting the lot.
Remind you: Checking the crossover works ONLY at the moment when a new bar is born. Reacting instantly to price crossing is quite dangerous and I don't see the logic in it.
Added:
pay attention to the"Work Time Frame" parameter - this is the one that sets the timeframe at which the new bar is caught. And already on the new bar of the "Work Time Frame" timeframe checks the crossing of price on H1. That is, if the"Work Time Frame" is set to M1, it means that crossing of our lines by the H1 bar will be checked once a minute.
Two Trend Line.mq5
version "1.002"
Fixed working with risk when setting the lot.
Remind you: Checking the crossover works ONLY at the moment when a new bar is born. Reacting instantly to price crossing is quite dangerous and I don't see the logic in it.
Added:
pay attention to the"Work Time Frame" parameter - this is the one that sets the timeframe at which the new bar is caught. And already on the new bar of the "Work Time Frame" timeframe checks the crossing of price on H1. That is, if the"Work Time Frame" is set to M1, it means that crossing of our lines by the H1 bar will be checked once a minute.
Problem. UP line is crossed, but SELL trade is hanging on. In the settings I set M1
Full set file with settings please. Template of the chart in the plotted lines. Dates from and to. Symbol and timeframe. Generally two tabs (Natstrokes and Parameters) from the Tester window.
Full set file with settings please. Chart template with lines drawn. Dates from and to. Symbol and timeframe. Generally two tabs (Natstrokes and Parameters) from the Tester window.
There is no problem with lines. Put them anywhere on the chart and they are automatically put where they should be on the new day. It's with them that everything is clear, all right. The problem is in the lag of working with orders.
I have not changed anything in settings other than timeframe and lot. I have called the lines as they should be. Everything is OK with lines. They fit on the chart like clockwork.
Full set file with settings please. Chart template with lines drawn. Dates from and to. Symbol and timeframe. Generally two tabs (Natstrokes and Parameters) from the Tester window.
I will only be able to record a video in the evening, if not decided by that time. I will directly show the points where the bot misses.