[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 334
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I agree. It outputs fine and everything is correct. I just needed to display the following output
Buf_0[i]=(Line2[i]+Line1[i])/Point/10;
It should be done in a separate loop. I prefer your version because I prefer the FOR loop. Thank you for your help and attention.
This is a newbie question not to clutter up the forum:
Does the broker differentiate between orders opened manually and by an Expert Advisor, and if the order is opened by a script? Does this order see as opened manually by an expert or broker also differentiate between orders opened by a script?
I'm not paranoid about forex, I'm just curious.
values from the obtained sample of optimized EA? The initial sampling, let's say, 5000 rows (runs) and 7 parameters. Thank you.
Good evening everyone.
Please help me out with this. I am trying to make an Expert Advisor on the intersection of 2 MAs. Open criterion is Buy: MA1>MA2 and Sell: MA1<MA2. The close criterion is the same. The problem is as follows: If an order is closed by a stop loss, it is reopened in the same direction and closed again by a stop loss and so on until the MA is crossed again. We should ensure that if a stop loss is triggered, we wait for the next crossing to open a new order.
Good evening everyone.
Please help me with this. I am trying to place an Expert Advisor on the intersection of 2 MAs. Open criterion is Buy: MA1>MA2 and Sell: MA1<MA2. The criterion for closing is the same. The problem is as follows: If an order is closed by a stop loss, it is reopened in the same direction and closed again by a stop loss and so on until the MA is crossed again. We should make it so that if a stop loss is triggered, we wait for the next crossing to open a new order.
First of all, the entry is not quite correct.
MA_1 = iMA(NULL,0,Period_MA_1,Sdvig_1,MODE_SMA,PRICE_CLOSE,0); // Call function indicator
MA_2 = iMA(NULL,0,Period_MA_2,Sdvig_2,MODE_SMA,PRICE_CLOSE,0);
Instead of zeros you should put 1
To determine the moment of intersection we should consider not only the current value (above or below, but also the previous one)
Therefore we should add
MA_1_Prev = iMA(NULL,0,Period_MA_1,Sdvig_1,MODE_SMA,PRICE_CLOSE,2); // Call indicator function
MA_2_Prev= iMA(NULL,0,Period_MA_2,Sdvig_2,MODE_SMA,PRICE_CLOSE,2);
note number 2
In other words, this block will now look like
MA_1 = iMA(NULL,0,Period_MA_1,Sdvig_1,MODE_SMA,PRICE_CLOSE,1); // Call function indicator
MA_2 = iMA(NULL,0,Period_MA_2,Sdvig_2,MODE_SMA,PRICE_CLOSE,1);
MA_1_Prev = iMA(NULL,0,Period_MA_1,Sdvig_1,MODE_SMA,PRICE_CLOSE,2); // Call indicator function
MA_2_Prev= iMA(NULL,0,Period_MA_2,Sdvig_2,MODE_SMA,PRICE_CLOSE,2);
The line
if (MA_2 < MA_1 && Fact_Up == true)
replace with if (MA_2 < MA_1 && MA_2_Prev>MA_1_Prev && Fact_Up == true)
Make the same replacement for the second condition and exit condition. The new condition is marked in blue. We will now enter a long position when the First Moving Average is greater than the Second, while the previous value of the First Moving Average is less than the previous value of the Second.
Good day. Please advise: using which "tools" (how - with what) to select the optimum
values from the obtained sample of the Expert Advisor's optimization? Initial sample, let's assume, 5000 lines (runs) and 7 parameters. Thank you.
https://www.mql5.com/ru/articles/1434 there's something discussed here
https://www.mql5.com/ru/articles/1517 and it's all very well explained here too. BUT!!!! Theory is one thing and practice is another. Not everything is as smooth as it is written. In general, this topic has long been discussed and there is no consensus. There are no rules - there are recommendations.
advise if anyone has seen an advisor that simply trades by render - any implementation... (it's supposed to just drain slowly at the expense of the spread)
So write it ... It seems simple. Take as the basis any Advisor. and set the condition IF OPEN IS BIGGER THAN SLOSE THEN OPEN UP OR DOWN
Так напиши его...Там вроде все просто. бери за основу люой советник. и ставь условие ЕСЛИ ОПЕН БОЛЬШЕ СЛОЗЕ ТО ОТКРЫВАЕМСЯ ВВЕРХ ИНАЧЕ ВНИЗ
I want an EA with an explicit use of random variables and as random as possible)) if I don't find one, I'll write