//+------------------------------------------------------------------+//| StringLowerCase |//+------------------------------------------------------------------+string StringLowerCase(string str)
{
string s = str;
int lenght = StringLen(str) - 1, symbol;
while(lenght >= 0)
{
symbol = StringGetChar(s, lenght);
if((symbol > 64 && symbol < 91) || (symbol > 191 && symbol < 224))
s = StringSetChar(s, lenght, symbol + 32);// тут possible loss of data due to type conversionelseif(symbol > -65 && symbol < -32)
s = StringSetChar(s, lenght, symbol + 288);// тут possible loss of data due to type conversion
lenght--;
}
return(s);
}
//+------------------------------------------------------------------+//| StringUpperCase |//+------------------------------------------------------------------+string StringUpperCase(string str)
{
string s = str;
int lenght = StringLen(str) - 1, symbol;
while(lenght >= 0)
{
symbol = StringGetChar(s, lenght);
if((symbol > 96 && symbol < 123) || (symbol > 223 && symbol < 256))
s = StringSetChar(s, lenght, symbol - 32);// тут possible loss of data due to type conversionelseif(symbol > -33 && symbol < 0)
s = StringSetChar(s, lenght, symbol + 224);// тут possible loss of data due to type conversion
lenght--;
}
return(s);
}
ありがとうございます。他に解決策はありますか?その後、EAはポジションをオープンし、すぐにクローズします。
条件によって時間を固定する必要があります。
で、ポジションがクローズ するまで更新しない。
で、現在時刻から記憶している時刻を引きます。
、指定した秒数が経過したら、ポジションを閉じます。
そうしました
double op = CalculateProfit();
int time_waiting=0;
if (op >= Profit)
time_waiting = TimeLocal() + 10;
if (TimeLocal() < time_waiting)
{
CloseAll();
}
が、エラーになります。
型変換によるデータ消失の可能 性
はエラーではなく、警告です。ある型から別の型に変換する際に、データが失われる可能性があります。
datetime time_waiting;
つまり、2銭と見てすぐにEAを閉じるのではなく、もう少し上げてほしいのです。
そして、10秒後には必ず利益が大きくなっているのはなぜか?)
に従った。
もし差し支えなければ、修正にご協力ください...。
全責任を負うこと
ユーソート
unsigned short型は ushort型で、これもサイズは2バイトである。最小値は0、最大値は65,535です。
イント
int型の サイズは4バイト(32ビット)である。最小値は-2 147 483 648、最大値は2 147 483 647です。
言われたとおりにしたのですが、CloseAll()関数の後に1時間のスリップがあるにもかかわらず、Expert Advisorを閉じた後になぜか数回のトレードが終了してしまうのです。
double op = CalculateProfit();
if (op >= Profit && LastTime == 0)
LastTime = TimeCurrent ();
if(LastTime > 0 && TimeCurrent () - LastTime >= Second)
{
CloseAll();
LastTime = 0;
SendNotification("Trade is over");
Sleep(60*60000);// 60.000 = 1 min
}.