Can someone please help me see the problem with this policy code?

Author: ewang23, Created: 2021-10-13 10:00:52, Updated:

I wrote an alarm pushing policy, the re-test has not pushed the signal, the real disk indicates an error, can you help me see the code problem.img

Period_list = [PERIOD_D1,126060,66060, 46060,36060, PERIOD_H1,45*60, PERIOD_M30, PERIOD_M15, PERIOD_M5, PERIOD_M1];// minute line lists This is a list of all the different ways PERIOD_H1,45*60, PERIOD_M30, PERIOD_M15, PERIOD_M5, and PERIOD_M1 are grouped. LastTime is 0. var malevel0 = new Array ((); // define a dictionary malevel0[symbol]=0; function OnBar ((record, symbol) is a function that is used to display a bar. {pos (192,210) } If (record == null) return; var len=record.length-1; If ((len < 200) is a return;

var ma200=TA.MA(record,ma_len)
var cci = talib.CCI(record, cci_len)
if(record[len].Open<ma200[len])
    malevel0[symbol]=1;
var con=(malevel0[symbol]==1) && record[len].Open>ma200[len] && cci[len]>cci_value
//Log("con",malevel0[symbol]l,malevel0,record[len].Open,ma200[len],cci[len],record[len-1].Open,ma200[len-1]);
if(con)
{
      malevel0[symbol]=0;
      str = _D(record[record.length - 1].Time);//把 此刻的 毫秒时间  转换成  字符串(能看懂的)
      Log("条件提示["+symbol+str+"]推送微信@" ); //输出一条信息  并推送微信
    
}

I'm not sure. /* function profit_order ((()// stop order {pos (192,210) } prices=get_last_price ((() is the last price if ((prices==null) return; If ((CheckPositionDirect (() ==1)// Multi-positioned {pos (192,210) }

   if( prices[0]-stop_price>profit_perent*stop_price/100)
   {
       Log("多止盈",prices[0],stop_price);
       ClosePosition(prices[0]);
       reset();
 
   }
 
 }else if(CheckPositionDirect()==-1)//空仓
 {
   if( stop_price-prices[1] >profit_perent*stop_price/100)
   {
       Log("空止盈",prices[1],stop_price);
       ClosePosition(prices[1]);
       reset();
 
   }
    
 }  

} */

// the main transaction logic function OnTick (symbol) {pos (192,210) }
//exchange.SetContractType ((swap button); //setContractType is used to create a contract. record = exchange.GetRecords ((Period_list[period]); If (record ==null) return; if (record[record.length - 1].Time!= lastTime) { //Log (the new K-line column is generated by log, symbol, record[record.length - 1].Time); lastTime = record[record.length - 1].Time; // Must update lastTime, this is critical.

         OnBar(record,symbol);//收盘价模式
       
    }

}

// platform based on tick level function main (() { Falg = 1; var contract_list=[BTC_USDT,ETH_USDT] For ((var i=0; i

     exchange.IO("currency", symbols)
     OnTick(symbols); 
     Sleep(500)  
    }
    
    
}

}


More

ewang23/upload/asset/1642f0eca89ded61e3f8d.png This is a list of all the different ways Upload/asset/1642f0eca89ded61e3f8d.png is credited in the database. Do not display false information

The grassClick on the bot page to see specific errors.