指定
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
int OnInit()
{
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Script deinit function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
ObjectDelete(_Symbol);
}
//+------------------------------------------------------------------+
//| Script tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double maFast, maSlow;
int idx = StartIndex();
if (_Symbol == "XAUUSD" || _Symbol == "EURUSD" || _Symbol == "USOIL")
{
maFast = iMA(_Symbol, PERIOD_M1, 13, 0, MODE_SMMA, PRICE_CLOSE, idx);
maSlow = iMA(_Symbol, PERIOD_M1, 26, 0, MODE_SMMA, PRICE_CLOSE, idx);
if (maFast > maSlow && maFast > maSlow)
{
int ticket = OrderSend(_Symbol, OP_BUY, 0.1, Ask, 3, Ask-20*Point, Ask+20*Point, "MyOrder", 0, 0, Green);
if (ticket > 0)
{
OrderModify(ticket, OrderOpenPrice(), OrderOpenPrice()-50*Point, OrderOpenPrice()+50*Point, 0, Blue);
Alert("Buy order sent!");
}
}
else if (maFast < maSlow && maFast < maSlow)
{
int ticket = OrderSend(_Symbol, OP_SELL, 0.1, Bid, 3, Bid+20*Point, Bid-20*Point, "MyOrder", 0, 0, Red);
if (ticket > 0)
{
OrderModify(ticket, OrderOpenPrice(), OrderOpenPrice()+50*Point, OrderOpenPrice()-50*Point, 0, Red);
Alert("Sell order sent!");
}
}
}
}
//+------------------------------------------------------------------+
//| Script properties |
//+------------------------------------------------------------------+
input string Expert_Title = "My Trading Bot";
input ulong Expert_MagicNumber = 22655;
input bool Expert_EveryTick = false;
input int Signal_ThresholdOpen = 10;
input int Signal_ThresholdClose = 10;
応答済み
1
評価
プロジェクト
17
29%
仲裁
5
20%
/
40%
期限切れ
1
6%
暇
2
評価
プロジェクト
9
22%
仲裁
0
期限切れ
0
暇
プロジェクト情報
予算
30+ USD
締め切り
最低 10 最高 15 日