//+------------------------------------------------------------------+
//| informindicatorML9.mq4 |
//| MOLET |
//| icq 459027664; possol@meta.ua |
//+------------------------------------------------------------------+
#property copyright "MOLET"
#property link "icq 459027664; possol@meta.ua"
#property indicator_chart_window
extern int posorder=0;
ObjectCreate("inf",OBJ_LABEL,0,0,0);
ObjectSet("inf",OBJPROP_CORNER,0);
ObjectSet("inf",OBJPROP_XDISTANCE,750);
ObjectSet("inf",OBJPROP_YDISTANCE,300);
ObjectSetText("inf","0",50,"Times New Roman",Gray);
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("inf");
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
double pr1,pr2;
double profit,losse;
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES)==false)
{
ObjectSetText("inf","0",50,"Times New Roman",Gray);
}
}
//--------------------
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_SELL)
if (OrderStopLoss()>0)
if (OrderTakeProfit()>0)
{
profit=Ask-OrderTakeProfit();
losse=OrderStopLoss()-Ask;
}
}
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_BUY)
if (OrderStopLoss()>0)
if (OrderTakeProfit()>0)
{
profit=OrderTakeProfit()-Bid;
losse=Bid-OrderStopLoss();
}
}
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_SELL)
if (OrderStopLoss()>0)
if (OrderTakeProfit()>0)
if (profit<losse)
{
ObjectSetText("inf",DoubleToStr((Ask-OrderTakeProfit())/Point,0),50,"Times New Roman",Green);
}
}
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_SELL)
if (OrderStopLoss()>0)
if (OrderTakeProfit()>0)
if (losse<=profit)
{
ObjectSetText("inf",DoubleToStr((OrderStopLoss()-Ask)/Point,0),50,"Times New Roman",Red);
}
}
//--------------
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_BUY)
if (OrderStopLoss()>0)
if (OrderTakeProfit()>0)
if (profit<losse)
{
ObjectSetText("inf",DoubleToStr((OrderTakeProfit()-Bid)/Point,0),50,"Times New Roman",Green);
}
}
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_BUY)
if (OrderStopLoss()>0)
if (OrderTakeProfit()>0)
if (losse<=profit)
{
ObjectSetText("inf",DoubleToStr((Bid-OrderStopLoss())/Point,0),50,"Times New Roman",Red);
}
}
//--------------------
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_SELL)
if (OrderStopLoss()>0)
if (OrderTakeProfit()==0)
{
ObjectSetText("inf",DoubleToStr((OrderStopLoss()-Ask)/Point,0),50,"Times New Roman",Red);
}
}
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_BUY)
if (OrderStopLoss()>0)
if (OrderTakeProfit()==0)
{
ObjectSetText("inf",DoubleToStr((Bid-OrderStopLoss())/Point,0),50,"Times New Roman",Red);
}
}
//--------------------
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_SELL)
if (OrderStopLoss()==0)
if (OrderTakeProfit()>0)
{
ObjectSetText("inf",DoubleToStr((Ask-OrderTakeProfit())/Point,0),50,"Times New Roman",Green);
}
}
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderType()==OP_BUY)
if (OrderStopLoss()==0)
if (OrderTakeProfit()>0)
{
ObjectSetText("inf",DoubleToStr((OrderTakeProfit()-Bid)/Point,0),50,"Times New Roman",Green);
}
}
//--------------------
{
if (OrderSelect(posorder,SELECT_BY_POS,MODE_TRADES))
if (OrderStopLoss()==0)
if (OrderTakeProfit()==0)
{
ObjectSetText("inf","0",50,"Times New Roman",Gray);
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments