以可承受損失資產百分比計算倉位大小:ui
extern double EquityPercent = 2 extern double StopLoss = 50 #計算風險資金額 double RiskAmount = AccountEquity()*(EquityPercent/100) #計算指訂貨幣的每點價值 double TickValue = MarketInfo(Symbol(),MODE_TICKVALUE); if(Point == 0.001//Point == 0.00001) TickValue *= 10; #計算倉位大小 double myLots = (RiskAmount/StopLoss)/TickValue