Скачать MetaTrader 5
Авторизуйтесь или зарегистрируйтесь, чтобы добавить комментарий
Подними скорость в сети MQL5 Cloud Network. Установи Strategy Tester Agent!
BAngel01
6
BAngel01 2013.11.09 12:20 
// Определение BAI, или Sell


double bid =MarketInfo(Symbol(),MODE_BID); // Запрос значения Bid
double ask =MarketInfo(Symbol(),MODE_ASK); // Запрос значения Ask
double point =MarketInfo(Symbol(),MODE_POINT);//Запрос Point


if (setalert == 1 && (pattern == "Shooting ShootStar 2"|| pattern == "Shooting ShootStar 3" || pattern == "Shooting ShootStar 4" || pattern == "Evening Star Pattern" || pattern == "Evening Doji Star Pattern" || pattern == "Dark Cloud Cover Pattern" || pattern == "Bearish Engulfing Pattern"))
{
int Nsde = OP_SELL;
int sena = (Bid-Point);
string col=Red;
}
if (setalert == 1 && (pattern == "Bullish Hammer 2" || pattern == "Bullish Hammer 3" || pattern == "Bullish Hammer 4" || pattern == "Morning Star Pattern" || pattern == "Morning Doji Pattern" || pattern == "Piercing Line Pattern" || pattern == "Bullish Engulfing Pattern"))
{
Nsde = OP_BUY;
sena = (Ask+Point);
col=Green;
//открытие сделки
if (IsTesting())
{
if (setalert == 1&&(pattern == "Shooting ShootStar 2"|| pattern == "Shooting ShootStar 3" || pattern == "Shooting ShootStar 4" || pattern == "Evening Star Pattern" || pattern == "Evening Doji Star Pattern" || pattern == "Dark Cloud Cover Pattern" || pattern == "Bearish Engulfing Pattern"||pattern == "Bullish Hammer 2" || pattern == "Bullish Hammer 3" || pattern == "Bullish Hammer 4" || pattern == "Morning Star Pattern" || pattern == "Morning Doji Pattern" || pattern == "Piercing Line Pattern" || pattern == "Bullish Engulfing Pattern"))
{
OrderSend(Symbol(),Nsde,lot,sena*Point,20,sena-15*Point,sena+15*Point,magic,NULL,0,col);
Print (GetLastError());
}
}
Gulnaz Akhtyamova
10630
Gulnaz Akhtyamova 2013.11.09 12:46  

Это ошибка, связанная с открытием ордера.

А что такое lot и чему это равно?

Alekseu Fedotov
721
Alekseu Fedotov 2013.11.09 13:12  
jyrik01:
// Определение BAI, или Sell



Во первых :

для встаки кода есть кнопочка SRC

Второе :

// Определение BAI, или Sell


 double bid =MarketInfo(Symbol(),MODE_BID); // Запрос значения Bid
 double ask =MarketInfo(Symbol(),MODE_ASK); // Запрос значения Ask
 double point =MarketInfo(Symbol(),MODE_POINT);//Запрос Point


 if (setalert == 1 && (pattern == "Shooting ShootStar 2"||
 pattern == "Shooting ShootStar 3" ||
 pattern == "Shooting ShootStar 4" ||
 pattern == "Evening Star Pattern" ||
 pattern == "Evening Doji Star Pattern" ||
 pattern == "Dark Cloud Cover Pattern" ||
 pattern == "Bearish Engulfing Pattern"))
 {
 int Nsde = OP_SELL;
 int sena = (Bid-Point);      // Обратите внимание на это
 string col=Red;
 }
 if (setalert == 1 && (pattern == "Bullish Hammer 2" ||
 pattern == "Bullish Hammer 3" ||
 pattern == "Bullish Hammer 4" || 
 pattern == "Morning Star Pattern" || 
 pattern == "Morning Doji Pattern" || 
 pattern == "Piercing Line Pattern" || 
 pattern == "Bullish Engulfing Pattern"))
 {
 Nsde = OP_BUY;
 sena = (Ask+Point);          // И   здесь
 col=Green;
 //открытие сделки
 if (IsTesting())
 {
 if (setalert == 1&&(pattern == "Shooting ShootStar 2"||
 pattern == "Shooting ShootStar 3" ||
 pattern == "Shooting ShootStar 4" || 
 pattern == "Evening Star Pattern" || 
 pattern == "Evening Doji Star Pattern" ||
 pattern == "Dark Cloud Cover Pattern" ||
 pattern == "Bearish Engulfing Pattern"||
 pattern == "Bullish Hammer 2" || 
 pattern == "Bullish Hammer 3" ||
 pattern == "Bullish Hammer 4" || 
 pattern == "Morning Star Pattern" ||
 pattern == "Morning Doji Pattern" || 
 pattern == "Piercing Line Pattern" || 
 pattern == "Bullish Engulfing Pattern"))
 {
 OrderSend(Symbol(),Nsde,lot,sena*Point,20,sena-15*Point,sena+15*Point,magic,NULL,0,col);
 Print (GetLastError()); 
 }
 }

Читаем матчасть

При открытии рыночного ордера (OP_SELL или OP_BUY) в качестве цены открытия могут использоваться только самые последние цены Bid (для продажи) или Ask (для покупки).

/
Авторизуйтесь или зарегистрируйтесь, чтобы добавить комментарий