input int TakeProfit = 5;
input double Lots = 0.01;
input int MagicNumber = 12345;
int OnInit()
{
return (INIT_SUCCEEDED);
}
void OnDeinit(const int reason)
{
}
void OnTick()
{
double UPArrow = iCustom(NULL, 0, "GCDC-SIGNAL", 2, 1);
double DWNArrow = iCustom(NULL, 0, "GCDC-SIGNAL", 3, 1);
if (UPArrow != EMPTY_VALUE && DWNArrow == EMPTY_VALUE)
{
OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, 0, Ask + TakeProfit * Point * 10, "Order Long", MagicNumber, 0, Red);
}
if (UPArrow == EMPTY_VALUE && DWNArrow != EMPTY_VALUE)
{
OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, 0, Bid - TakeProfit * Point * 10, "Order Short", MagicNumber, 0, Blue);
}
}
暂无评论