|
- void 画记录()
- {
- color Signal_color;
- double close_price=0;
- double open_price=0;
- string BS,ZFH;
- double high=iHigh(NULL,0,iHighest(NULL,0,MODE_HIGH,(int)ChartGetInteger(0,CHART_VISIBLE_BARS),0));
- double low=iLow(NULL,0,iLowest(NULL,0,MODE_LOW,(int)ChartGetInteger(0,CHART_VISIBLE_BARS),0));
- int orders_chart_visible=0;
- for(int i=HistoryTotal(); i>=0; i--)
- {
- if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==true)
- {
- if(OrderSymbol()==Symbol() && OrderOpenTime()>=Time[(int)ChartGetInteger(0,CHART_VISIBLE_BARS)])
- {
- if(OrderType()<2)
- {
- if(OrderType()==0)
- BS="/";
- if(OrderType()==1)
- BS="\";
- if(OrderProfit()>=0)
- {
- Signal_color=clrLime;
- ZFH=" +";
- }
- else
- {
- Signal_color=clrDeepPink;
- ZFH=" -";
- }
- orders_chart_visible++;
- double CO_price=OrderClosePrice()-OrderOpenPrice();
- int N;
- N=(int)MathMod(i+7,7);
- open_price=high+(high-low)/90*4-(high-low)/80*N;
- datetime CO_time=OrderCloseTime()-OrderOpenTime();
- ObjectCreate("均线系统_订单_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJ_TREND,0,OrderOpenTime(),OrderOpenPrice(),OrderCloseTime(),OrderClosePrice());
- //ObjectCreate("均线系统_订单_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJ_TREND,0,OrderOpenTime(),open_price,OrderCloseTime(),close_price);
- ObjectSet("均线系统_订单_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJPROP_COLOR,Signal_color);
- ObjectSet("均线系统_订单_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJPROP_RAY,false);
- ObjectSet("均线系统_订单_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJPROP_WIDTH,1);
- ObjectSet("均线系统_订单_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJPROP_STYLE,STYLE_DOT);
- //ObjectSet((string)i,OBJPROP_BACK,true);
- ObjectCreate("均线系统_订单_竖线o_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJ_TREND,0,OrderOpenTime(),OrderOpenPrice(),OrderOpenTime(),open_price);
- ObjectSet("均线系统_订单_竖线o_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$", OBJPROP_RAY, false);
- ObjectSet("均线系统_订单_竖线o_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJPROP_COLOR,C'40,40,40,');
- ObjectSet("均线系统_订单_竖线o_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJPROP_STYLE,STYLE_DOT);
- /*ObjectCreate("均线系统_订单_竖线c_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJ_TREND,0,OrderCloseTime(),OrderClosePrice(),OrderCloseTime(),close_price);
- ObjectSet("均线系统_订单_竖线c_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$", OBJPROP_RAY, false);
- ObjectSet("均线系统_订单_竖线c_"+(string)i+":"+DoubleToStr(OrderLots(),2)+"手:"+ZFH+DoubleToStr(MathAbs(OrderProfit()),2)+"$",OBJPROP_COLOR,C'30,30,30,');*/
- //text("均线系统_订单_单量_"+(string)i,ANCHOR_RIGHT, 8,"Arial",Signal_color,DoubleToStr(OrderLots(),2)+" 手 ",OrderOpenTime(),open_price);
- text("均线系统_订单_多空_"+(string)i,ANCHOR_LEFT, 10,"Arial",Signal_color,BS,OrderOpenTime(),open_price);
- text("均线系统_订单_盈亏_"+(string)i,ANCHOR_LEFT, 8,"Arial",Signal_color," "+DoubleToStr(OrderLots(),2)+ZFH+DoubleToStr(MathAbs(OrderProfit()),0),OrderOpenTime(),open_price);
- double profit_all=0;
- profit_all+=OrderProfit();
- string zfh="";
- if(profit_all>=0)
- zfh="+ ";
- else
- zfh="- ";
- text("均线系统_订单_盈亏统计",ANCHOR_LEFT_UPPER,14,"Arial",clrRed," 窗口内历史订单 "+IntegerToString(orders_chart_visible)+" 个:"+zfh+DoubleToStr(MathAbs(profit_all),2)+" $",Time[0],low);
- }
- }
- }
- }
- }
复制代码 |
|