Where have you been before? You're right. I've added it, it works.
Thank you very much from me too! I've been "pestering" with this question on various threads here - here's one "fruitful" at last :)) !
Another question from another point of view: if I prescribe an order opening at Open[0] after МА crossing 40% of positions are not opened - I ignore them completely (more correctly, 40%)) and if I prescribe an opening at Ask or Bid - it opens a lot of "extra" positions which should not be opened. This is especially relevant to currencies with big spreads, such as EURNZD, for instance.
Can you fight it? If I open with Open[0] slippage equal to spread, it acts like with Ask opening - in other words, it is a vicious circle.
//+------------------------------------------------------------------+//| Check for open order conditions |//+------------------------------------------------------------------+void CheckForOpen()
{
double ma;
int res;
//---- go trading only for first tiks of new barif(Volume[0]>1) return;
//---- get Moving Average
ma=iMA(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,0);
//---- sell conditionsif(Open[1]>ma && Close[1]<ma)
{
res=OrderSend(Symbol(),OP_SELL,Lots,Bid,30,Bid+Stoploss*Point,Bid-Takeprofit*Point,"",MAGICMA,0,Red);
return;
}
//---- buy conditionsif(Open[1]<ma && Close[1]>ma)
{
res=OrderSend(Symbol(),OP_BUY,Lots,Ask,30,Ask-Stoploss*Point,Ask+Takeprofit*Point,"",MAGICMA,0,Blue);
return;
}
//----
}
Thank you very much from me too! I've been "pestering" with this question on various threads here - here's one "fruitful" at last :)) !
Another question from another point of view: if I prescribe an order opening at Open[0] after МА crossing 40% of positions are not opened - I ignore them completely (more precisely 40%)) and if I prescribe an opening at Ask or Bid - it opens a lot of "extra" positions which should not be opened. This is especially relevant to currencies with big spreads, such as EURNZD, for instance.
Can you fight it? If I set the slippage at the Open[0] opening equal to the spread, it acts like on the Ask opening - in other words, it is a vicious circle.
Thank you very much from me too! I've been "pestering" with this question on various threads here - here's one "fruitful" at last :)) !
Another question from another direction: if I prescribe an order opening at Open[0] after МА crossing 40% of positions are not opened - I completely ignore them (more correctly, 40% of them)) and if I prescribe an opening at Ask or Bid - it opens a lot of "extra" positions which should not be opened. This is especially relevant to currencies with big spreads, such as EURNZD, for instance.
Can you fight it? If I open with Open[0], the slippage is equal to the value of spread, then it works like with Ask opening - in other words, it is a vicious circle.
To open a Buy position, one should use the Ask price and open a Sell position using the Bid price.
It is necessary to check the result returned by the OrderSend() function. If the position is opened, it must be taken into account that the buy/sell signal is passed and not to repeat the opening request, but to wait for the next signal.
The buy position must be opened at Ask price and the sell position at Bid price.
You have to check the result returned by the OrderSend() function. If you open an order, you must take into account that the buy/sell signal is gone and not repeat the opening request, but wait for the next signal.
Yes! In fact, I cannot correctly write the following :
- If on the given bar the position was closed at StopLoss, and it is suitable by parameters for opening a new position, it should NEVER be opened on it! In other words -
StopLoss - (1)
OPEN - (0) for the current bar.
Then the Expert Advisor works optimally - a minimum of "unnecessary" positions.
- If a position has closed at StopLoss on a given bar, and it is suitable for opening a new position according to the parameters, then you should NEVER open a position on it! In other words -
StopLoss - (1)
OPEN - (0) for the current bar.
Then the Expert Advisor works optimally - a minimum of "unnecessary" positions.
And I always get some kind of abracadabra... :((
I told you to set the timer not to open for 4 bars after the stop is triggered
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Where have you been before? You're right. I've added it, it works.
Thank you very much from me too! I've been "pestering" with this question on various threads here - here's one "fruitful" at last :)) !
Another question from another point of view: if I prescribe an order opening at Open[0] after МА crossing 40% of positions are not opened - I ignore them completely (more correctly, 40%)) and if I prescribe an opening at Ask or Bid - it opens a lot of "extra" positions which should not be opened. This is especially relevant to currencies with big spreads, such as EURNZD, for instance.
Can you fight it? If I open with Open[0] slippage equal to spread, it acts like with Ask opening - in other words, it is a vicious circle.
Thank you very much from me too! I've been "pestering" with this question on various threads here - here's one "fruitful" at last :)) !
Another question from another point of view: if I prescribe an order opening at Open[0] after МА crossing 40% of positions are not opened - I ignore them completely (more precisely 40%)) and if I prescribe an opening at Ask or Bid - it opens a lot of "extra" positions which should not be opened. This is especially relevant to currencies with big spreads, such as EURNZD, for instance.
Can you fight it? If I set the slippage at the Open[0] opening equal to the spread, it acts like on the Ask opening - in other words, it is a vicious circle.
Have you tried to control the number of open positions?
Well done, Victor!
And the cloud is silent... :))
Have you tried controlling the number of open positions?
Thank you very much from me too! I've been "pestering" with this question on various threads here - here's one "fruitful" at last :)) !
Another question from another direction: if I prescribe an order opening at Open[0] after МА crossing 40% of positions are not opened - I completely ignore them (more correctly, 40% of them)) and if I prescribe an opening at Ask or Bid - it opens a lot of "extra" positions which should not be opened. This is especially relevant to currencies with big spreads, such as EURNZD, for instance.
Can you fight it? If I open with Open[0], the slippage is equal to the value of spread, then it works like with Ask opening - in other words, it is a vicious circle.
To open a Buy position, one should use the Ask price and open a Sell position using the Bid price.
It is necessary to check the result returned by the OrderSend() function. If the position is opened, it must be taken into account that the buy/sell signal is passed and not to repeat the opening request, but to wait for the next signal.
The buy position must be opened at Ask price and the sell position at Bid price.
You have to check the result returned by the OrderSend() function. If you open an order, you must take into account that the buy/sell signal is gone and not repeat the opening request, but wait for the next signal.
Yes! In fact, I cannot correctly write the following :
- If on the given bar the position was closed at StopLoss, and it is suitable by parameters for opening a new position, it should NEVER be opened on it! In other words -
StopLoss - (1)
OPEN - (0) for the current bar.
Then the Expert Advisor works optimally - a minimum of "unnecessary" positions.
And I always get some kind of abracadabra.
Yes! Actually, I can't get the following right :
- If a position has closed at StopLoss on a given bar, and it is suitable for opening a new position according to the parameters, then you should NEVER open a position on it! In other words -
StopLoss - (1)
OPEN - (0) for the current bar.
Then the Expert Advisor works optimally - a minimum of "unnecessary" positions.
And I always get some kind of abracadabra... :((
i told you, set the timer not to open for 4 bars after the stop is triggered
I remember :), your advice is good, but "it's all about nuances", as PapaYozh puts it !
When working with averages every bar counts - statistics, you know! :)) - so you have to look for other, more subtle, solutions....
Good afternoon to all forum members!
Couldn't find answers to the following questions.
1. Two terminals are running on different machines (first one at work, second one at home), on the same real account.
If one Expert Advisor on one and the same currency pair is running on these terminals, on the same currency pair,
is it equivalent to running the same EA on the same pair in different windows of the same terminal?
2. If you disable the operation of EAs in one of these terminals (by using the appropriate button), how will this
affect another terminal?
(Thank you in advance!)