エラーの内容です。
==
-operand expected
;
- unexpected token
closePrice
- constant expression required
{
- some operator expected
expression has no effect
4 errors 1 warning
下記内容になります。
場所はSELECT_BY_TICKETとでてくる下の行からです。
よろしくお願いしましす。
int doOrderSend(int type, double lots, double openPrice, int slippage, double stoploss, double closePrice, string comment, int magic, int &errCode) {
openPrice = NormalizeDouble(openPrice, Digits);
stoploss = NormalizeDouble(stoploss, Digits);
closePrice = NormalizeDouble(closePrice, Digits);
int starttime = GetTickCount();
while(true) {
if(GetTickCount() - starttime > WAIT_TIME * 1000) {
Print("OrderSend timeout. Check the experts log.");
return(false);
}
if(IsTradeAllowed() == true) {
RefreshRates();
// int ticket = OrderSend(Symbol(), type, lots, openPrice, slippage, stoploss, closePrice, comment, magic, 0, ArrowColor[type]);
// if( ticket > 0) {
int ticket = OrderSend(Symbol(), type, lots, openPrice, slippage, 0, 0, comment, magic, 0, ArrowColor[type]);
if( ticket > 0) {
if(OrderSelect(ticket,SELECT_BY_TICKET)==true){
if(isBuyTrapG)==true{ //true kai
clocePrice = openPrice + profitPipsG * pointPerPips;
}else { //else =false uri
closePrice = openPrice - profitPipsG * pointPerPips;
}
closePrice = NormalizeDouble(closePrice, Digits);
if(OrderModify(OrderTicket(),OrderOpenPrice(),0,closePrice,0,WhiteSmoke)){}
}
return(ticket);
}
errCode = GetLastError();
Print("[OrderSendError] : ", errCode, " ", ErrorDescription(errCode));
Print("price=",openPrice,": stop=",stoploss,": close=",closePrice);
if(errCode == ERR_INVALID_PRICE || errCode == ERR_INVALID_STOPS) {
break;
}
}
Sleep(100);
}
return(-1);
}
bool initOrderTicketInfo(){
// 対象通貨ペアの件数を取得
int orderCount=0;
for(int j=0; j < OrdersTotal(); j++) {
if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES) == false) return(false);
if(OrderSymbol() == Symbol()) {
orderCount++;
}
}
// 配列を初期化
ArrayResize(ticketArray,orderCount);
ArrayResize(magicArray,orderCount);
orderCount=0;
// 配列にセット
for(j=0; j < OrdersTotal(); j++) {
if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES) == false) return(false);
if(OrderSymbol() == Symbol()) {
ticketArray[orderCount] = OrderTicket();
magicArray[orderCount] = OrderMagicNumber();
orderCount++;
}
}
return(true);
}
// 指定されたMAGIC注文があるかどうかをチェックする
//
int getOrderTicket(int magic){
int orderCount = 0;
int ticket = -1;
for(int i=0; i < ArraySize(magicArray); i++) {
if(magic == magicArray[i]) {
ticket = ticketArray[i];
orderCount++;
}
}
if(orderCount > 1){
Print("order duplicate:MagicNumber=",magic,", orderCount=",orderCount);
}
return(ticket);
}