需要自己造函数
if(AccountProfit()<0) a=MathMin(AccountProfit(),a); //求a跟AccountProfit()最小值 if(AccountProfit()>0) b=MathMax(AccountProfit(),b); //求b跟AccountProfit()最大值
試看看 這樣應該就行的
Hung Wen Lin:
谢谢!
試看看 這樣應該就行的
yixin1928:
谢谢!
谢谢!
忘記提醒
跨時需要將a,b歸零
if(TimeMinute(TimeCurrent())==0) { a=0; b=0; }
Hung Wen Lin:
忘記提醒
跨時需要將a,b歸零
谢谢!我试试
if(shijian())
{
if(AccountProfit()< 0 && a > AccountProfit()) a = AccountProfit();
if(AccountProfit()> 0 && b < AccountProfit()) b = AccountProfit();
}
Labe1("wenzi_1",700,30,12,"最大浮亏 :" +DoubleToString(a,2),"微软雅黑",clrRed);
Labe1("wenzi_2",700,50,12,"最大浮盈 :" +DoubleToString(b,2),"微软雅黑",clrRed);
我这个只能记录负数的最少值和正数的最大值
如果1小时内都是正数时不能记录最小值或者 1小时内都是负数时不能记录最大值