From 0a26f3469f6394bf017aa72d71afc9a2b47efbf4 Mon Sep 17 00:00:00 2001 From: Garfield Date: Tue, 24 Mar 2026 15:00:08 -0400 Subject: [PATCH] Fix type conversion errors in OrdersEA_Smart_Grid Changed initEquity from int to double to fix: - Line 217: double - int subtraction - Line 226: int * double / double calculation - Added explicit cast for BaseEquity assignment This resolves implicit type conversion warnings/errors in MT5. --- OrdersEA_Smart_Grid.mq5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OrdersEA_Smart_Grid.mq5 b/OrdersEA_Smart_Grid.mq5 index b220a4c..c39e8e5 100644 --- a/OrdersEA_Smart_Grid.mq5 +++ b/OrdersEA_Smart_Grid.mq5 @@ -102,7 +102,7 @@ bool BelowLow; int tradeLogId; double closeOnProfit; bool bGetOutOK, bOpenNewTradesOK; -int initEquity; +double initEquity; int lotDigits; bool bWithdrawMailSent= false; bool bGetOutHandled; @@ -303,7 +303,7 @@ int OnInit() trade.SetDeviationInPoints(10); trade.SetTypeFilling(ORDER_FILLING_IOC); - initEquity = BaseEquity; + initEquity = (double)BaseEquity; lotDigits = 2; double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);