Questions from Beginners MQL4 MT4 MetaTrader 4 - page 127
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
Need MQ4 source code
Citizens, please advise how to express the logic in the code!
I have on the chart MA.... and I need it to trigger SELL, if the candle crossed the MA upwards downwards and BUY, if the candle crossed from below upwards....
Thanks in advance!
Citizens, please advise how to express the logic in the code!
I have on the chart MA.... and I need it to trigger SELL, if the candle crossed the MA upwards downwards and BUY, if the candle crossed from below upwards....
Thanks in advance!
there is an Expert Advisor in the terminal, Moving Average.mq4 - it's already done there. It works perfectly
Greetings.
Can you please tell me how to "slip" into MT4 tester a created history file with a timeframe that is not in the tester (or other options)?
The point is that there is an Expert Advisor, from here http://tradelikeapro.ru/grafiki-renko/ which creates a real-time history file in Renko candlesticks with a non-standard timeframe. We need to test it using the created file. However, renaming the resulting history file with a non-standard timeframe does not help. The tester shows TestGenerator: no history data 'GBPUSD5' from 2017.01.05 to 2017.06.14 It is created in the real time, not from the history, because the history does not get a very correct chart. Or, tweak the indicator itself so it creates a chart with the standard timeframe, preliminarily removing the appropriate one from the history. I have so far only managed to correct it so it creates a file but it is empty.
Greetings.
Can you please tell me how to "slip" into MT4 tester a created history file with a timeframe that is not in the tester (or other options)?
The point is that there is an Expert Advisor, from here http://tradelikeapro.ru/grafiki-renko/ which creates a real-time history file in Renko candlesticks with a non-standard timeframe. We need to test it using the created file. However, renaming the resulting history file with a non-standard timeframe does not help. The tester shows TestGenerator: no history data 'GBPUSD5' from 2017.01.05 to 2017.06.14 It is created in the real time, not from the history, because the history does not get very correctly. Or, tweak the indicator itself so it creates a chart with the standard timeframe, preliminarily removing the appropriate one from the history. I have so far only managed to correct it so it creates a file but it is empty.
The Renko chart is the result of overlaying a low pass filter with a backlash on the history. MA gives a smooth curve, but Renko gives a stepped curve because of the backlash. Save the result of filtering in an array and keep working... I'll be free in a week or two and I'll get down to it
Can you guys tell me how to write in the code of the Expert Advisor to open 3 trades at once with the possibility of setting LS?
Here is my condition
I've been advised to use(OrdersTotal()) function, but it does not fit my case. I wrote it like this
It compiles well, no errors, but it is not appropriate for my case.
Ie its logic is as follows:
The first order is opened by a condition, and when other conditions appear, the first order is closed and the second order is opened by other conditions!!! Maybe there is somewhere to read about it?
I did what I could! But the orders will not close Help plz...
MA1_1 = iMA(_Symbol, _Period, ma1, 0, ma1_method, ma1_Price, 2);
MA2_0 = iMA(_Symbol, _Period, ma2, 0, ma2_method, ma2_Price, 1);
MA2_1 = iMA(_Symbol, _Period, ma2, 0, ma2_method, ma2_Price, 2);
if(MA1_0 < MA2_0 && MA1_1 >= MA2_1) //sell
{
if(tp > 0) TP = NormalizeDouble(Bid - tp * _Point, _Digits); else TP = NULL;
ticket = OrderSend(_Symbol, OP_SELL, lot, Bid, slippage, 0, TP, NULL, Magic, 0, clrRed); //sell
Print("Error opening a sell order");
}
else
{
Print("Successful opening of the sell order");
}
else if(MA1_0 > MA2_0 && MA1_1 <= MA2_1)//buy
{
ticket_close = OrderClose (ticket, lot, Bid, slippage, clrRed);
Print("Sell order successfully closed");
}
else
{
Print("Error at closing the sell order");
}
Citizens, please advise where to find an EA (order flipper)...
Ie its logic is as follows:
The first order is opened by a condition, and when other conditions appear, the first order is closed and the second order is opened by other conditions!!! Maybe there is somewhere to read about it?
I did what I could! But the orders will not close Help plz...
MA1_1 = iMA(_Symbol, _Period, ma1, 0, ma1_method, ma1_Price, 2);
MA2_0 = iMA(_Symbol, _Period, ma2, 0, ma2_method, ma2_Price, 1);
MA2_1 = iMA(_Symbol, _Period, ma2, 0, ma2_method, ma2_Price, 2);
if(MA1_0 < MA2_0 && MA1_1 >= MA2_1) //sell
{
if(tp > 0) TP = NormalizeDouble(Bid - tp * _Point, _Digits); else TP = NULL;
ticket = OrderSend(_Symbol, OP_SELL, lot, Bid, slippage, 0, TP, NULL, Magic, 0, clrRed); //sell
Print("Error opening a sell order");
}
else
{
Print("Successful opening of the sell order");
}
else if(MA1_0 > MA2_0 && MA1_1 <= MA2_1)//buy
{
ticket_close = OrderClose (ticket, lot, Bid, slippage, clrRed);
Print("Sell order successfully closed");
}
else
{
Print("Error at closing the sell order");
}
Sell order is closed at Ask price
Can you please advise why the EA stops seeing its own orders (opens several orders instead of one) if there are other orders beside its own? If the orders are only those of the EA, there is no problem. When opening an order the "Medjik" is set and only orders with this "Medjik" are selected according to the conditions of opening the order.
You have a break and need to continue