//+------------------------------------------------------------------+ //| Trend_Final_Equivalent_v16.mq5 | //| Orijinal trend following adds ile geliştirilmiş| //| Geliştirilmiş Versiyon v16 (Sekanas Architect) | //+------------------------------------------------------------------+ /// Değişiklik: V1.x: İşlemci optimizasyonu için Sk-N1H entegre edildi. / CPU optimization integrated with Sk-N1H. /// Değişiklik: V16.1: Bilingual destek eklendi, ManageDrawdown fonksiyonu tamamlandı. / Bilingual support added, ManageDrawdown fixed. #property copyright "Aydın Sarıhan" #property version "16.1" #property strict #include CTrade trade; #define MAX_RETRY 3 // Hata durumunda maksimum deneme sayısı / Max retry count on error // ================================================================== // BÖLÜM 2: GİRİŞ PARAMETRELERİ (INPUTS) // ================================================================== enum LotAss { Fixed = 0, AutoMM = 1, BalanceRatio = 2 }; input group "Lot Yönetimi Ayarları / Lot Management Settings" input LotAss LotAssignment = Fixed; input double FixedLots = 0.01; input double PercentageRisk = 0.1; input int PercentageRiskBasedOnSekanasMovement = 100; input double ForEvery = 1000; input double UseLotsForEveryBalance = 0.01; input group "İşlem Ayarları / Trading Settings" input int TakeProfit_Sk = 60; // Toplam kar hedefi (Sekanas) / Total profit target (Sekanas) input double Trail_Sk = 30; // İzleyen Stop (Sekanas) / Trailing Stop (Sekanas) input double TrailStart_Sk = 10; // İzleyen Stop Başlangıcı (Sekanas) / Trailing Start (Sekanas) input int OpenTime = 1; // Referans güncelleme aralığı (saniye) / Ref update interval (sec) input int Magic = 2026; // Sihirli Sayı / Magic Number input double SekanasStep = 5; // Sekanas adımı (giriş ve ekleme için) / Sekanas step (entry & add) input group "Risk Yönetimi / Risk Management" input double MaxDrawdown_USD = 0.0; // Maksimum Günlük Zarar ($) (0=Kapalı) / Max Daily Drawdown ($) (0=Disabled) input group "Ek Giriş Ayarları / Additional Entry Settings" input bool UseTrendAdds = true; // Trend yönünde ekleme yap / Add positions in trend direction input double TrendAddStep_Sk = 50; // Trend ekleme adımı (Sekanas) / Trend add step (Sekanas) input int TrendMaxAdds = 5; // Maksimum ekleme sayısı / Maximum addition count input group "Zaman ve Spread Filtresi / Time and Spread Filter" input int TimeStart = 2; // Başlangıç Saati / Start Time input int TimeEnd = 23; // Bitiş Saati / End Time input double MaxSpread_Sk = 80.0; // Maksimum Spread (Sekanas) / Maximum Spread (Sekanas) input group "Dinamik Sekanas Adım Ayarları / Dynamic Sekanas Step Settings" input bool EnableDynamicSekanasStep = true; input double LossTrigger_Sk = 10.0; // Zarar tetikleyici (Sekanas) / Loss trigger (Sekanas) input double StepAdjustment_Sk = 4.0; // Adım ayarlaması (Sekanas) / Step adjustment (Sekanas) input bool ScaleByPositionCount = true; // Pozisyon sayısına göre ölçekle / Scale by position count input double ScalingFactor = 2.0; // Ölçekleme faktörü / Scaling factor input group "Görsel Ayarları / Visual Settings" input bool Info = true; // Bilgi panelini göster / Show info panel input color TextColor = clrWhite; input color InfoDataColor = clrDodgerBlue; input color FonColor = clrBlack; input int FontSizeInfo = 10; input int SpeedEA = 50; // EA Hızı (ms) / EA Speed (ms) input group "Sekanas Step Görselleştirme Ayarları / Sekanas Step Visual Settings" input bool ShowSekanasStepLines = true; // Adım çizgilerini göster / Show step lines input color BuyTriggerLineColor = clrLime; input color SellTriggerLineColor = clrRed; input int LineWidth = 2; input ENUM_LINE_STYLE LineStyle = STYLE_DASH; // ================================================================== // BÖLÜM 3: GLOBAL DEĞİŞKENLER & SABİTLER / GLOBAL VARIABLES // ================================================================== datetime g_lastH1BarTime = 0; // Son H1 mumunun açılış zamanı / Last H1 bar open time double g_SekanasNorm1H_Value = 0.0; // Önbelleğe alınmış Sk-N1H Parasal Değeri / Cached Sk-N1H Monetary Value double g_Sekanas_Price_Move = 0.0; // 1 Sk fiyat hareketinin karşılığı / Price equivalent of 1 Sk string EA_COMMENT = "TRADING Scalper"; string BUY_TRIGGER_LINE_NAME = "BuyTriggerLine"; string SELL_TRIGGER_LINE_NAME = "SellTriggerLine"; datetime lastReferenceTime = 0; double lastReferencePrice = 0.0; double todayProfit = 0.0; datetime lastCheckedDay = 0; bool isTradingAllowedToday = true; bool drawdownCloseFlag = false; datetime lastDrawdownDayTime = 0; double Bid=0.0, Ask=0.0; double currentSekanasStep = 0.0; double lastAddBuyPrice = 0.0; double lastAddSellPrice = 0.0; int addBuyCount = 0; int addSellCount = 0; int previousPositionCount = 0; // ================================================================== // BÖLÜM 8: YARDIMCI FONKSİYONLAR / HELPER FUNCTIONS // ================================================================== void UpdateSekanasNorm1H() { datetime currentH1Time = iTime(_Symbol, PERIOD_H1, 0); if(currentH1Time == g_lastH1BarTime) return; // CPU Tasarrufu / CPU Optimization g_lastH1BarTime = currentH1Time; double h1OpenPrice = iOpen(_Symbol, PERIOD_H1, 0); double contractSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_CONTRACT_SIZE); g_Sekanas_Price_Move = h1OpenPrice * (1.0 / 10000.0); g_SekanasNorm1H_Value = g_Sekanas_Price_Move * contractSize; } void SafeObjectDelete(const string name) { if(ObjectFind(ChartID(), name) >= 0) ObjectDelete(ChartID(), name); } void InitAddTrackers() { addBuyCount = 0; addSellCount = 0; lastAddBuyPrice = 0.0; lastAddSellPrice = 0.0; for(int i=PositionsTotal()-1; i>=0; i--) { ulong ticket = PositionGetTicket(i); if(PositionSelectByTicket(ticket)) { if(PositionGetInteger(POSITION_MAGIC) == Magic && PositionGetString(POSITION_SYMBOL) == _Symbol) { int type = (int)PositionGetInteger(POSITION_TYPE); double openPrice = PositionGetDouble(POSITION_PRICE_OPEN); if(type == POSITION_TYPE_BUY) { addBuyCount++; if(lastAddBuyPrice == 0.0 || openPrice > lastAddBuyPrice) lastAddBuyPrice = openPrice; } else if(type == POSITION_TYPE_SELL) { addSellCount++; if(lastAddSellPrice == 0.0 || openPrice < lastAddSellPrice) lastAddSellPrice = openPrice; } } } } } double CalculateLots() { double lots = FixedLots; switch(LotAssignment) { case AutoMM: { double balance = AccountInfoDouble(ACCOUNT_BALANCE); double riskAmount = balance * (PercentageRisk / 100.0); // Sekanas bazlı parasal risk hesaplaması / Sekanas-based monetary risk calculation double stopLossValue = PercentageRiskBasedOnSekanasMovement * g_SekanasNorm1H_Value; if(stopLossValue > 0) lots = riskAmount / stopLossValue; break; } case BalanceRatio: { lots = MathFloor(AccountInfoDouble(ACCOUNT_BALANCE) / ForEvery) * UseLotsForEveryBalance; break; } default: lots = FixedLots; } double minLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN); double maxLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX); double lotStep = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP); if(lotStep <= 0) lotStep = 0.01; lots = MathFloor(lots / lotStep) * lotStep; if(lots < minLot) lots = minLot; if(lots > maxLot) lots = maxLot; return(lots); } void UpdateDailyProfit() { datetime today = TimeCurrent() - (TimeCurrent() % 86400); if(today != lastCheckedDay) { todayProfit = 0; isTradingAllowedToday = true; lastCheckedDay = today; drawdownCloseFlag = false; // Yeni günde bayrağı sıfırla / Reset flag on new day } double profit = 0.0; if(HistorySelect((long)today, (long)(TimeCurrent() + 86400))) { uint total = HistoryDealsTotal(); for(uint i=0; i0 && HistoryDealGetInteger(dealTicket, DEAL_MAGIC) == Magic && HistoryDealGetInteger(dealTicket, DEAL_ENTRY) == DEAL_ENTRY_OUT) { profit += HistoryDealGetDouble(dealTicket, DEAL_PROFIT); profit += HistoryDealGetDouble(dealTicket, DEAL_SWAP); profit += HistoryDealGetDouble(dealTicket, DEAL_COMMISSION); } } } todayProfit = profit; } void CloseAllTrades(string reason) { int closedCount = 0; for(int i=PositionsTotal()-1; i>=0; i--) { ulong ticket = PositionGetTicket(i); if(PositionSelectByTicket(ticket) && PositionGetInteger(POSITION_MAGIC) == Magic && PositionGetString(POSITION_SYMBOL) == _Symbol) { for(int retry = 0; retry < MAX_RETRY; retry++) { if(trade.PositionClose(ticket, ULONG_MAX)) { closedCount++; break; } else { Print("Kapatma hatası / Close error. Deneme/Retry: ", retry + 1, " Hata/Error: ", GetLastError()); Sleep(500); } } } } if(closedCount>0) { drawdownCloseFlag = true; lastDrawdownDayTime = (datetime)(TimeCurrent() - (TimeCurrent() % 86400)); Print("Tüm işlemler kapatıldı / All trades closed. Sebep / Reason: ", reason); InitAddTrackers(); lastReferencePrice = Bid; lastReferenceTime = TimeCurrent(); } } void ManageDrawdown() { if(MaxDrawdown_USD <= 0.0) return; // Drawdown kontrolü kapalı / Drawdown check disabled double currentProfit = 0.0; for(int i=PositionsTotal()-1; i>=0; i--) { ulong ticket = PositionGetTicket(i); if(PositionSelectByTicket(ticket) && PositionGetInteger(POSITION_MAGIC) == Magic && PositionGetString(POSITION_SYMBOL) == _Symbol) { // Swap maliyeti hesaba eklendi / Swap cost added to calculation currentProfit += PositionGetDouble(POSITION_PROFIT) + PositionGetDouble(POSITION_SWAP); } } // Eğer anlık zarar limiti aştıysa işlemleri kapat / Close trades if current loss exceeds limit if(currentProfit <= -MaxDrawdown_USD) { CloseAllTrades("Maksimum Drawdown Aşıldı / Max Drawdown Exceeded!"); } } void ApplyTrailingStop() { if(g_Sekanas_Price_Move <= 0.0) return; double trailPriceDist = Trail_Sk * g_Sekanas_Price_Move; double trailStartDist = TrailStart_Sk * g_Sekanas_Price_Move; // Broker'in izin verdiği minimum stop seviyesini ham fiyat düzlemine çekiyoruz / Get broker min stop level double minStopDistance = SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) * _Point; for(int i=PositionsTotal()-1; i>=0; i--) { ulong ticket = PositionGetTicket(i); if(PositionSelectByTicket(ticket) && PositionGetInteger(POSITION_MAGIC) == Magic && PositionGetString(POSITION_SYMBOL) == _Symbol) { double openPrice = PositionGetDouble(POSITION_PRICE_OPEN); double currentSL = PositionGetDouble(POSITION_SL); double currentTP = PositionGetDouble(POSITION_TP); int type = (int)PositionGetInteger(POSITION_TYPE); if(type == POSITION_TYPE_BUY) { double newSL = NormalizeDouble(Bid - trailPriceDist, _Digits); if ((Bid - newSL) < minStopDistance) continue; if(Bid > openPrice + trailStartDist && (currentSL < newSL || currentSL == 0.0)) { for(int retry = 0; retry < MAX_RETRY; retry++) { if(trade.PositionModify(ticket, newSL, currentTP)) break; Print("Trail Modify Hata / Error (Buy). Hata / Error Code: ", GetLastError()); } } } else if(type == POSITION_TYPE_SELL) { double newSL = NormalizeDouble(Ask + trailPriceDist, _Digits); if ((newSL - Ask) < minStopDistance) continue; if(Ask < openPrice - trailStartDist && (currentSL > newSL || currentSL == 0.0)) { for(int retry = 0; retry < MAX_RETRY; retry++) { if(trade.PositionModify(ticket, newSL, currentTP)) break; Print("Trail Modify Hata / Error (Sell). Hata / Error Code: ", GetLastError()); } } } } } } void UpdateDynamicSekanasStep() { currentSekanasStep = SekanasStep; if(!EnableDynamicSekanasStep) return; int buyPositions = 0, sellPositions = 0; bool buyIsInLoss = false, sellIsInLoss = false; double lossDist = LossTrigger_Sk * g_Sekanas_Price_Move; for(int i=PositionsTotal()-1; i>=0; i--) { ulong ticket = PositionGetTicket(i); if(PositionSelectByTicket(ticket) && PositionGetInteger(POSITION_MAGIC) == Magic && PositionGetString(POSITION_SYMBOL) == _Symbol) { double openPrice = PositionGetDouble(POSITION_PRICE_OPEN); int type = (int)PositionGetInteger(POSITION_TYPE); if(type == POSITION_TYPE_BUY) { buyPositions++; if(Bid < openPrice - lossDist) buyIsInLoss = true; } else if(type == POSITION_TYPE_SELL) { sellPositions++; if(Ask > openPrice + lossDist) sellIsInLoss = true; } } } if(buyIsInLoss || sellIsInLoss) currentSekanasStep += StepAdjustment_Sk; if(ScaleByPositionCount) { currentSekanasStep += (buyPositions + sellPositions) * ScalingFactor; } currentSekanasStep = MathMax(currentSekanasStep, 10.0); } void UpdateVisualLines() { if(!ShowSekanasStepLines) { SafeObjectDelete(BUY_TRIGGER_LINE_NAME); SafeObjectDelete(SELL_TRIGGER_LINE_NAME); return; } if(lastReferencePrice <= 0 || g_Sekanas_Price_Move <= 0.0) return; double buyTriggerPrice = lastReferencePrice + currentSekanasStep * g_Sekanas_Price_Move; double sellTriggerPrice = lastReferencePrice - currentSekanasStep * g_Sekanas_Price_Move; if(ObjectFind(ChartID(), BUY_TRIGGER_LINE_NAME) < 0) { if(ObjectCreate(ChartID(), BUY_TRIGGER_LINE_NAME, OBJ_HLINE, 0, 0, buyTriggerPrice)) { ObjectSetInteger(ChartID(), BUY_TRIGGER_LINE_NAME, OBJPROP_COLOR, BuyTriggerLineColor); ObjectSetInteger(ChartID(), BUY_TRIGGER_LINE_NAME, OBJPROP_WIDTH, LineWidth); ObjectSetInteger(ChartID(), BUY_TRIGGER_LINE_NAME, OBJPROP_STYLE, LineStyle); } } else { ObjectSetDouble(ChartID(), BUY_TRIGGER_LINE_NAME, OBJPROP_PRICE, buyTriggerPrice); } if(ObjectFind(ChartID(), SELL_TRIGGER_LINE_NAME) < 0) { if(ObjectCreate(ChartID(), SELL_TRIGGER_LINE_NAME, OBJ_HLINE, 0, 0, sellTriggerPrice)) { ObjectSetInteger(ChartID(), SELL_TRIGGER_LINE_NAME, OBJPROP_COLOR, SellTriggerLineColor); ObjectSetInteger(ChartID(), SELL_TRIGGER_LINE_NAME, OBJPROP_WIDTH, LineWidth); ObjectSetInteger(ChartID(), SELL_TRIGGER_LINE_NAME, OBJPROP_STYLE, LineStyle); } } else { ObjectSetDouble(ChartID(), SELL_TRIGGER_LINE_NAME, OBJPROP_PRICE, sellTriggerPrice); } ChartRedraw(); } bool OpenPosition(ENUM_POSITION_TYPE type, double lots, string reason) { bool result = false; double sl = 0.0, tp = 0.0; for(int retry = 0; retry < MAX_RETRY; retry++) { if (type == POSITION_TYPE_BUY) { result = trade.Buy(lots, _Symbol, 0.0, sl, tp, EA_COMMENT); } else if (type == POSITION_TYPE_SELL) { result = trade.Sell(lots, _Symbol, 0.0, sl, tp, EA_COMMENT); } if (result) { Print(EnumToString(type), " açıldı / opened (", reason, "): lots=", DoubleToString(lots, 2)); if(type == POSITION_TYPE_BUY) { addBuyCount++; lastAddBuyPrice = Ask; } else { addSellCount++; lastAddSellPrice = Bid; } return true; } else { Print(EnumToString(type), " açma hatası / open error (", reason, "). Deneme / Retry: ", retry + 1, " Hata Kodu / Error Code: ", GetLastError()); Sleep(500); // 500 ms bekleme / wait 500 ms } } return false; } // ================================================================== // BÖLÜM 4: ANA OLAY YÖNETİCİLERİ (MAIN EVENT HANDLERS) // ================================================================== int OnInit() { trade.SetExpertMagicNumber(Magic); lastCheckedDay = TimeCurrent() - (TimeCurrent() % 86400); lastReferenceTime = 0; lastReferencePrice = 0.0; InitAddTrackers(); previousPositionCount = PositionsTotal(); UpdateSekanasNorm1H(); EventSetMillisecondTimer(MathMax(50, SpeedEA)); return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { EventKillTimer(); SafeObjectDelete(BUY_TRIGGER_LINE_NAME); SafeObjectDelete(SELL_TRIGGER_LINE_NAME); ChartRedraw(); } void OnTimer() { OnTick(); } void OnTick() { UpdateSekanasNorm1H(); // En başta Sk-N1H güncellenmeli / Update Sk-N1H first Bid = SymbolInfoDouble(_Symbol, SYMBOL_BID); Ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK); UpdateDailyProfit(); ManageDrawdown(); if(drawdownCloseFlag) return; UpdateDynamicSekanasStep(); if(g_Sekanas_Price_Move > 0.0) { double currentSpreadSk = (Ask - Bid) / g_Sekanas_Price_Move; if(MaxSpread_Sk > 0 && currentSpreadSk > MaxSpread_Sk) { if(Info) UpdateChartInfo("Spread çok yüksek / Spread too high"); return; } } if(lastReferenceTime == 0) { lastReferenceTime = TimeCurrent(); lastReferencePrice = Bid; } // Referans güncelle / Update reference if(TimeCurrent() >= lastReferenceTime + OpenTime) { lastReferenceTime = TimeCurrent(); lastReferencePrice = Bid; } UpdateVisualLines(); bool canOpenBuy = false, canOpenSell = false; MqlDateTime dt; TimeToStruct(TimeCurrent(), dt); bool inTradingHours = (dt.hour >= TimeStart && dt.hour < TimeEnd); if(inTradingHours && TimeCurrent() <= lastReferenceTime + OpenTime && g_Sekanas_Price_Move > 0.0) { canOpenBuy = (Bid >= lastReferencePrice + currentSekanasStep * g_Sekanas_Price_Move); canOpenSell = (Bid <= lastReferencePrice - currentSekanasStep * g_Sekanas_Price_Move); } int buyCount=0, sellCount=0, totalPositions=0; for(int i=PositionsTotal()-1; i>=0; i--) { ulong t = PositionGetTicket(i); if(PositionSelectByTicket(t) && PositionGetInteger(POSITION_MAGIC) == Magic && PositionGetString(POSITION_SYMBOL) == _Symbol) { totalPositions++; if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY) buyCount++; else if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL) sellCount++; } } double lots = CalculateLots(); if(totalPositions == 0) { if(canOpenBuy) OpenPosition(POSITION_TYPE_BUY, lots, "İlk Giriş / First Entry"); else if(canOpenSell) OpenPosition(POSITION_TYPE_SELL, lots, "İlk Giriş / First Entry"); } if(UseTrendAdds && totalPositions > 0 && g_Sekanas_Price_Move > 0.0) { if(buyCount > 0 && addBuyCount < TrendMaxAdds) { if(lastAddBuyPrice == 0.0) InitAddTrackers(); double threshold = lastAddBuyPrice + TrendAddStep_Sk * g_Sekanas_Price_Move; if(Bid >= threshold) { OpenPosition(POSITION_TYPE_BUY, lots, "Trend Ekleme / Trend Addition"); } } if(sellCount > 0 && addSellCount < TrendMaxAdds) { if(lastAddSellPrice == 0.0) InitAddTrackers(); double threshold = lastAddSellPrice - TrendAddStep_Sk * g_Sekanas_Price_Move; if(Bid <= threshold) { OpenPosition(POSITION_TYPE_SELL, lots, "Trend Ekleme / Trend Addition"); } } } int currentPositions = PositionsTotal(); if (currentPositions != previousPositionCount) { InitAddTrackers(); previousPositionCount = currentPositions; } double totalProfit = 0.0, totalLots = 0.0; int tradeCount = 0; for(int i=PositionsTotal()-1; i>=0; i--) { ulong t = PositionGetTicket(i); if(PositionSelectByTicket(t) && PositionGetInteger(POSITION_MAGIC) == Magic && PositionGetString(POSITION_SYMBOL) == _Symbol) { totalProfit += PositionGetDouble(POSITION_PROFIT) + PositionGetDouble(POSITION_SWAP); totalLots += PositionGetDouble(POSITION_VOLUME); tradeCount++; } } if(TakeProfit_Sk > 0 && totalLots > 0 && g_SekanasNorm1H_Value > 0.0) { // TP hedefini Sk-N1H'nin parasal değeri ($) üzerinden lot hacmiyle oranlıyoruz / Scale TP target by Sk-N1H USD value and lot size double takeProfitUSD = totalLots * TakeProfit_Sk * g_SekanasNorm1H_Value; if(totalProfit >= takeProfitUSD) { CloseAllTrades("Toplam Kar Hedefi (Sk) / Total Profit Target (Sk)"); return; } } if(Trail_Sk > 0 && tradeCount >= 1) ApplyTrailingStop(); if(Info) UpdateChartInfo("İşlem bekleniyor... / Waiting for trade..."); } // ================================================================== // BÖLÜM 9: UI / CHART INFO // ================================================================== void UpdateChartInfo(string status) { string name = "INFO_LOGO"; if(ObjectFind(ChartID(), name) < 0) { ObjectCreate(ChartID(), name, OBJ_LABEL, 0, 0, 0); ObjectSetInteger(ChartID(), name, OBJPROP_XDISTANCE, 10); ObjectSetString(ChartID(), name, OBJPROP_FONT, "Arial"); ObjectSetInteger(ChartID(), name, OBJPROP_FONTSIZE, FontSizeInfo); } ObjectSetInteger(ChartID(), name, OBJPROP_YDISTANCE, 20); ObjectSetString(ChartID(), name, OBJPROP_TEXT, "iTrend EA v16.1 - Sekanas Architect Mode"); ObjectSetInteger(ChartID(), name, OBJPROP_COLOR, TextColor); name = "INFO_Profit"; if(ObjectFind(ChartID(), name) < 0) { ObjectCreate(ChartID(), name, OBJ_LABEL, 0, 0, 0); ObjectSetInteger(ChartID(), name, OBJPROP_XDISTANCE, 10); ObjectSetString(ChartID(), name, OBJPROP_FONT, "Arial"); ObjectSetInteger(ChartID(), name, OBJPROP_FONTSIZE, FontSizeInfo); } ObjectSetInteger(ChartID(), name, OBJPROP_YDISTANCE, 40); ObjectSetString(ChartID(), name, OBJPROP_TEXT, "Bugün Kar / Daily Profit: " + DoubleToString(todayProfit, 2)); ObjectSetInteger(ChartID(), name, OBJPROP_COLOR, todayProfit >= 0 ? clrLimeGreen : clrRed); name = "INFO_Status"; if(ObjectFind(ChartID(), name) < 0) { ObjectCreate(ChartID(), name, OBJ_LABEL, 0, 0, 0); ObjectSetInteger(ChartID(), name, OBJPROP_XDISTANCE, 10); ObjectSetString(ChartID(), name, OBJPROP_FONT, "Arial"); ObjectSetInteger(ChartID(), name, OBJPROP_FONTSIZE, FontSizeInfo); } ObjectSetInteger(ChartID(), name, OBJPROP_YDISTANCE, 60); ObjectSetString(ChartID(), name, OBJPROP_TEXT, "Durum / Status: " + status); ObjectSetInteger(ChartID(), name, OBJPROP_COLOR, InfoDataColor); ChartRedraw(); }