1 附件 任何人都可以幫助對此代碼進行細微的更改嗎?
我希望 SL 範圍從 5 點到 20 點。
如果有人可以提供幫助,我將需要新代碼作為 .mq4 文件
問候
搶
#財產版權
#屬性鏈接
#屬性嚴格
#property indicator_separate_window
外部 int 字體大小=8;
外部顏色字體顏色=深天藍;
extern int XDistance=10;//X 位置
extern int YDistance=10;//Y位置
extern double Risk=2;//風險(%)
//------------------------------------------------ --------------------
初始化初始化()
{
指標短名稱();
返回(0);
}
int deinit()
{
評論();
對象刪除所有();
返回(0);
}
//------------------------------------------------ --------------------
整數條數 = 0;
int 總利潤 = 0;
int 總損失 = 0;
int countbuy = 0;
int countsell = 0;
整數開始()
{
雙 bal = AccountEquity();
字符串 s = SL (點數)|;
字符串 s2 = 手數 |;
make_label(sl,s,XDistance,YDistance);
make_label(lots,s2,XDistance,YDistance (FontSize*2));
for(int i = 0; i lt;= 20; i )
{
雙倍手數 = (bal*(Risk/100.0))((10 i)*10* MarketInfo(Symbol(), MODE_TICKVALUE));
if(0.01 == MarketInfo(0,MODE_MINLOT))
{
很多 = NormalizeDouble(lot,2);
如果(手 lt; 0.01){手 = 0.01;}
別的{}
}
否則 if(0.1 == MarketInfo(0,MODE_MINLOT))
{
很多 = NormalizeDouble(很多,1);
如果(手 lt; 0.1){手 = 0.1;}
別的{}
}
否則 if(1.0 == MarketInfo(0,MODE_MINLOT))
{
手數 = NormalizeDouble(手數,0);
如果(手 lt; 1.0){手 = 1.0;}
別的{}
}
別的{}
s = (10 i) |;
s2 = DoubleToStr(lot,2) |;
make_label(sl i,s,XDistance (0 (FontSize*8)) ((10 (FontSize*4))*i),YDistance);
make_label(lots i,s2,XDistance (0 (FontSize*8)) ((10 (FontSize*4))*i),YDistance (FontSize*2));
}
返回(0);
}
無效 DrawPriceHHLine(日期時間 x1,日期時間 x2,雙 y1,
double y2, color lineColor, double style)
{
字符串標籤 = HHLine.0# DoubleToStr(x2, 0) lineColor;
對象刪除(標籤);
ObjectCreate(label, OBJ_TREND, 0, x1, y1, x2, y2, 0, 0);
對象集(標籤,OBJPROP_RAY,0);
ObjectSet(label, OBJPROP_COLOR, lineColor);
對象集(標籤,OBJPROP_STYLE,樣式);
對象集(標籤,OBJPROP_WIDTH,1);
}
無效 make_label(字符串 sl,字符串 l,int x,int y)
{
ObjectCreate(l sl, OBJ_LABEL, WindowsTotal()-1, 0, 0);
ObjectSetText(l sl, l , FontSize, Verdana, FontColor);
對象集(l sl,OBJPROP_CORNER,0);
對象集(l sl,OBJPROP_XDISTANCE,x);
ObjectSet(l sl, OBJPROP_YDISTANCE, y);
}