دة كود اكسبيرت جرب اعمله بالذكاء الاصطناعي ، ياريت لو احد الأخوة ينهيه و يعمله ملف جاهز احطه علي الميتاتريدر 4 و تكون شغالة ديمو و حقيقي ان امكن
//+------------------------------------------------------------------+
//| FibonacciStrategy.mq4|
//| Copyright 2024, MetaQuotes Software Corp. |
//|
[عذراً, فقط الأعضاء يمكنهم مشاهدة الروابط ] |
//+------------------------------------------------------------------+
#property strict
// Input parameters
input int fastLength = 9;
input int slowLength = 21;
input double stopLossPercent = 1.0;
input double fibLevel1 = 0.5;
input double fibLevel2 = 0.618;
input double fibLevel3 = 0.786;
input double fibLevel4 = 0.886;
input double targetLevel = 0.382;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double fastMA = iMA(NULL, 0, fastLength, 0, MODE_SMA, PRICE_CLOSE, 0);
double slowMA = iMA(NULL, 0, slowLength, 0, MODE_SMA, PRICE_CLOSE, 0);
// Check for crossover
if(fastMA > slowMA)
{
// Enter long position
double stopLoss = NormalizeDouble(Bid - (stopLossPercent / 100) * (Ask - Bid), Digits);
double takeProfit = NormalizeDouble(Bid + targetLevel * (Ask - Bid), Digits);
OrderSend(Symbol(), OP_BUY, 0.1, Ask, 3, stopLoss, takeProfit, "Buy", 0, 0, clrGreen);
}
else if(fastMA < slowMA)
{
// Enter short position
double stopLoss = NormalizeDouble(Ask + (stopLossPercent / 100) * (Ask - Bid), Digits);
double takeProfit = NormalizeDouble(Bid - targetLevel * (Ask - Bid), Digits);
OrderSend(Symbol(), OP_SELL, 0.1, Bid, 3, stopLoss, takeProfit, "Sell", 0, 0, clrRed);
}
}
//+------------------------------------------------------------------+