Navigation´╝ÜHome > Content >

profitgraphSELL.mq4

Time: 2012-11-07 | Download file:profitgraphSELL.mq4

//+-----------+
//| LSMA      |
//+-----------+
#property  copyright "Copyright 2005 Ron Thompson"
#property  link      "http://www.forexmt4.com/"

//---- indicator settings
#property  indicator_separate_window

#property indicator_buffers   7

#property indicator_color1  Red
#property indicator_width1  2
#property indicator_color2  Red
#property indicator_width2  2
#property indicator_color3  Red
#property indicator_width3  2
#property indicator_color4  Red
#property indicator_width4  2
#property indicator_color5  Red
#property indicator_width5  2
#property indicator_color6  Red
#property indicator_width6  2
#property indicator_color7  Red
#property indicator_width7  2


//---- buffers
double B1[];  //Yellow
double B2[];  //Green
double B3[];  //Red
double B4[];  //Blue
double B5[];  //Aqua
double B6[];  //LawnGreen
double B7[];  //Yellow



//+-----------+
//| Init      |
//+-----------+
int init()
  {
   // 233 up arrow
   // 234 down arrow
   // 158 little dot
   // 159 big dot
   // 168 open square
   // 120 box with X

   SetIndexBuffer(0,B1);
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);

   SetIndexBuffer(1,B2);
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);

   SetIndexBuffer(2,B3);
   SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 2);

   SetIndexBuffer(3,B4);
   SetIndexStyle(3, DRAW_LINE, STYLE_SOLID, 2);

   SetIndexBuffer(4,B5);
   SetIndexStyle(4, DRAW_LINE, STYLE_SOLID, 2);

   SetIndexBuffer(5,B6);
   SetIndexStyle(5, DRAW_LINE, STYLE_SOLID, 2);

   SetIndexBuffer(6,B7);
   SetIndexStyle(6, DRAW_LINE, STYLE_SOLID, 2);



   Print("Init complete");
  }

//+-----------+
//| DE-Init   |
//+-----------+
int deinit()
  {
   Print("DE-Init complete");
  }


//+-----------+
//| Each Tick |
//+-----------+
int start()
  {   
   int ptr=0;
   
   for(int i=OrdersTotal()-1; i>=0; i--)
     {
      OrderSelect(i, SELECT_BY_POS);
      if ( OrderType()== OP_SELL) ptr++;
           
      if(ptr==1) {B1[0]=(OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT); SetIndexLabel(0,OrderSymbol());}
      if(ptr==2) {B2[0]=(OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT); SetIndexLabel(1,OrderSymbol());}
      if(ptr==3) {B3[0]=(OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT); SetIndexLabel(2,OrderSymbol());}
      if(ptr==4) {B4[0]=(OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT); SetIndexLabel(3,OrderSymbol());}
      if(ptr==5) {B5[0]=(OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT); SetIndexLabel(4,OrderSymbol());}
      if(ptr==6) {B6[0]=(OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT); SetIndexLabel(5,OrderSymbol());}
      if(ptr==7) {B7[0]=(OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT); SetIndexLabel(6,OrderSymbol());}
      
     }
      
   }//start


Recommend