Print
定义
public void Print(string msg,PrintType p = PrintType.Info)
参数
| 参数名 |
类型 |
描述 |
| msg |
string |
需要打印的日志 |
| PrintType |
PrintType |
打印类型:默认PrintType.Info,异常为PrintType.Error |
public override void OnData(Slice slice)
{
//按照251天内盈亏比升序排序,取前10条
List<string> codes= ProfitRatioSort(true, 10, 251).ToList();
//打印排序后的股票代码
Print($"{codes.ToJson()}");
///打印异常
Print($"{codes.ToJson()}",PrintType.Error);
}
#打印Log
self.Print(fr"Buy Symbol:{symbol} Price: {order_ticket.AverageFillPrice}")
#打印Error Log
self.PrintError(fr"Buy Symbol:{symbol} Price: {order_ticket.AverageFillPrice}")