MrGreen86
Гуру форума
А в каком месте кода это нужно вставить??
PHP:
void start() {
int b,s;
double price,price_b,price_s,lot,lot_s,lot_b,SLb,SLs;
double CS_buy,CS_sell;
for (int i=0; i<OrdersTotal(); i++) {
if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES) && OrderSymbol()==Symbol()) {
price = OrderOpenPrice();
lot = OrderLots();
if (OrderType()==OP_BUY ) {
price_b = price_b+price*lot;
b++;
lot_b=lot_b+lot;
CS_buy=CS_buy+OrderCommission()+OrderSwap();
}
if (OrderType()==OP_SELL) {
price_s = price_s+price*lot;
s++;
lot_s=lot_s+lot;
CS_sell=CS_sell+OrderCommission()+OrderSwap();
}
}
}
ObjectDelete("SLb");
double tick_value=MarketInfo(Symbol(),MODE_TICKVALUE);
double delta_lot=MathAbs(lot_b-lot_s);
if((b!=0 || s!=0) && delta_lot>0.0) {
SLb= (price_b-price_s)/(lot_b-lot_s);
CS_buy=CS_buy+CS_sell;
if(lot_b>lot_s) {
SLb = SLb - (CS_buy/(tick_value*delta_lot))*Point;
}
if(lot_b<lot_s) {
SLb = SLb + (CS_buy/(tick_value*delta_lot))*Point;
}
ObjectCreate("SLb",OBJ_ARROW,0,Time[0],SLb,0,0,0,0);
ObjectSet ("SLb",OBJPROP_ARROWCODE,6);
ObjectSet ("SLb",OBJPROP_COLOR, clrGreen);
}
}
if((b!=0 || s!=0) && delta_lot>0.0) {
Последнее редактирование: