//+------------------------------------------------------------------+
//|                                                     toyotoyo.mq4 |
//|                                                          ......h |
//|                                                    hayseedfx.com |
//+------------------------------------------------------------------+
#property copyright "......h"
#property link      "hayseedfx.com"

#property indicator_chart_window

extern double entry       = 0.0;
extern bool   comments    = false;
extern bool   display     = true ;
extern int    horizontal  = 40;
extern int    vertical    = 40;
       
       
      
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
    if(entry == 0.0) Alert("Set Entry Price");
    
    double percent;
    
    percent = ((Ask-entry)/entry)*100;

    if(comments)
    {
    Comment(DoubleToStr(percent,2)+"  %");
    }
    
    if(display)
    {
     Display("percent",  horizontal,vertical);
     ObjectSetText("percent", DoubleToStr(percent,2)+ " %", 12, "Verdana", Lime);
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+



 
 void Display(string name, int x, int y)
   {
   ObjectCreate(name, OBJ_LABEL, 0, 0, 0);
   ObjectSet(name, OBJPROP_CORNER, 0);
   ObjectSet(name, OBJPROP_XDISTANCE, x);
   ObjectSet(name, OBJPROP_YDISTANCE, y);
   ObjectSet(name, OBJPROP_BACK, FALSE);
   }   
 



