#property indicator_separate_window              //for putting text in seperate window (part 1)

extern int Risk= 1;
extern color Entry_Colour=Green;
extern color SL_Colour=Red;
extern bool Hide_Line=false;
extern bool Hide_All=false;

double Enter,SL,Pips=Point*10,Pipvalue,multiplier, Lots, TOR_SL, CommissionMultiplier;
double DollarRisk=(AccountBalance())*Risk/100;
//+------------------------------------------------------------------+
int init(){
   IndicatorShortName("Order Info");
   return(INIT_SUCCEEDED);}
//+------------------------------------------------------------------+ 
int deinit(){
if(UninitializeReason()!=3){ObjectDelete("Entry");ObjectDelete("SL");ObjectDelete("E");ObjectDelete("S");ObjectDelete("SP");ObjectDelete("Lots");}}
//+------------------------------------------------------------------+
int start() {   
   if(Digits==5|| Digits==3){ multiplier=MathPow(10,Digits-1);}
   else{ multiplier=MathPow(10,Digits);}
   if(Digits==5|| Digits==3){ Pipvalue=MarketInfo(NULL,MODE_TICKVALUE)*10;}
   else{ Pipvalue=MarketInfo(NULL,MODE_TICKVALUE);}

if(Hide_All==false){
if(Hide_Line==false ){
      if(ObjectCreate(0,"Entry",OBJ_HLINE,0,0,Bid+10*Pips,0,0)) { 
        ObjectSetInteger(0,"Entry",OBJPROP_COLOR,Entry_Colour); }
      if(ObjectCreate(0,"SL",OBJ_HLINE,0,0,Bid-10*Pips,0,0)) { 
        ObjectSetInteger(0,"SL",OBJPROP_COLOR,SL_Colour); }}

Enter=ObjectGetDouble(0,"Entry",OBJPROP_PRICE,0);
SL=ObjectGetDouble(0,"SL",OBJPROP_PRICE,0);
TOR_SL=NormalizeDouble(MathAbs(Enter-SL)/Pips,1);
Lots=DollarRisk/(Pipvalue*TOR_SL);
SetText("E","Entry =  "+DoubleToStr(Enter,Digits),550,5,Red,10);
SetText("S","SL =  "+DoubleToStr(SL,Digits),400,5,Red,10);
SetText("SP","SL Pips =  "+DoubleToStr(TOR_SL,2),250,5,Red,10);
SetText("Lots","Lots =  "+DoubleToStr(Lots,2),100,5,Red,10);}

if(Hide_All){
ObjectDelete("E");ObjectDelete("S");ObjectDelete("SP");ObjectDelete("Lots");}

ChartRedraw(0);
ObjectGetDouble(0,"Entry",OBJPROP_PRICE,0);
ObjectGetDouble(0,"SL",OBJPROP_PRICE,0);
}
//+------------------------------------------------------------------+
void SetText(string name,string text,int x,int y,color colour,int fontsize=12) {
   if(ObjectCreate(0,name,OBJ_LABEL,WindowFind("Order Info"),0,0)) {    // //for putting text in seperate window (part 2)
      ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x); 
      ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
      ObjectSetInteger(0,name,OBJPROP_COLOR,colour);
      ObjectSetInteger(0,name,OBJPROP_FONTSIZE,fontsize);
      ObjectSetInteger(0,name,OBJPROP_HIDDEN,true);
      ObjectSetInteger(0,name,OBJPROP_SELECTABLE,0);
      ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_RIGHT_UPPER); }
   ObjectSetString(0,name,OBJPROP_TEXT,text);
   ObjectSetInteger(0,name,OBJPROP_COLOR,colour); }
//+------------------------------------------------------------------+