Download MetaTrader 5

could any one please help me assigning each button to its task ,, thanks in advance

To add comments, please log in or register
Have you discovered something really important? Write an article and receive 200 USD!
3ammary
348
3ammary 2012.04.14 01:59 

mk

 hello

please i have this expert

http://www.mediafire.com/?aaj0h2t10enx8io
i need every button to do its task 

the key is in this code

////////////....................//////////

//logic of x1 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<540 && XY[1]<29) ///adddddddd
{
click=0;
continue;
}
//logic of x3 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<400 && XY[1]<29) ///aass
{
click=11;
continue;
}
//logic of x5 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=14;
continue;
}
//logic of x7 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=17;
continue;
}
//logic of x9 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=20;
continue;
}
//logic of x11 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=23;
continue;
}
//logic of x13 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=26;
continue;
}
//logic of x15 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=29;
continue;
}
//////////////...................///////////

//////////////////////////////////////////////////////

bool OnClick(int& XY[2], int& WindowSize[2])
{int pci[5];
int lpRect[4];
static bool clicked;
static int prevcursor;
bool result=false;
int click = GetAsyncKeyState(1);
if(GetTopWindow(parent2)!=parent1) return(false);
if(GetForegroundWindow() != parent3) return(false);
pci[0]=20;
if(GetCursorInfo(pci))
{if(GetWindowRect(WindowHandle(Symbol(),Period()),lpRect))
{if(!clicked && prevcursor==cursor && click<0 && pci[3]>lpRect[0]+5 && pci[3]<lpRect[2]-42 && pci[4]>lpRect[1]+5 && pci[4]<lpRect[3]-21)
{clicked = true;
result = true;
XY[0] = pci[3]-(lpRect[0]+5);
XY[1] = pci[4]-(lpRect[1]+5); }
WindowSize[0] = (lpRect[2]-42) - (lpRect[0]+5);
WindowSize[1] = (lpRect[3]-21) - (lpRect[1]+5); }
if(click==0) clicked = false;
prevcursor = pci[2]; }
return(result); }
bool XY2PriceBar(int XY[],int Size[], double& PriceTime[])
{int PXperBar = (Size[0]/WindowBarsPerChart()/2)*2;
if(PXperBar<1) PXperBar=1;
int Clicked_Bar = WindowFirstVisibleBar() - NormalizeDouble((XY[0]-0.0)/PXperBar,0);
double PXperPoint = Size[1]/((WindowPriceMax()-WindowPriceMin())/Point);
double Clicked_Price = NormalizeDouble(WindowPriceMax() - XY[1]/PXperPoint*Point ,Digits);
if(Clicked_Bar<0) Clicked_Bar=0;
PriceTime[0] = Clicked_Price;
PriceTime[1] = Clicked_Bar;
if(PriceTime[0]>Point && PriceTime[1]>EMPTY) return(true);
else return(false);}

/////////////////////////////////////////////////////////



but i don't know what is xy and what is WindowSize

could any one please modify it for me ,,,

or just tell me what are those variables

xy[0]

xy[1]

WindowSize [0]



thanks alot in advance

onewithzachy
2271
onewithzachy 2012.04.14 02:10  

1. Please post your code using SRC button.

 

2. That's an MQL4 codes so you have to go MQL4.com

3ammary
348
3ammary 2012.04.14 04:08  
i put it there
3ammary
348
3ammary 2012.04.14 04:09  

but please could any one tell me 

what are those variables

xy[0]

xy[1]

WindowSize [0]

////////////....................//////////

//logic of x1 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<540 && XY[1]<29) ///adddddddd
{
click=0;
continue;
}
//logic of x3 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<400 && XY[1]<29) ///aass
{
click=11;
continue;
}
//logic of x5 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=14;
continue;
}
//logic of x7 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=17;
continue;
}
//logic of x9 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=20;
continue;
}
//logic of x11 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=23;
continue;
}
//logic of x13 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=26;
continue;
}
//logic of x15 button
if(WindowSize[0]-XY[0]>5 && WindowSize[0]-XY[0]<100 && XY[1]<29) ///adddddddd
{
click=29;
continue;
}
//////////////...................///////////

////////////////////////////////////////////////////// 

bool OnClick(int& XY[2], int& WindowSize[2])
{int pci[5];
int lpRect[4];
static bool clicked;
static int prevcursor;
bool result=false;
int click = GetAsyncKeyState(1);
if(GetTopWindow(parent2)!=parent1) return(false); 
if(GetForegroundWindow() != parent3) return(false); 
pci[0]=20; 
if(GetCursorInfo(pci)) 
{if(GetWindowRect(WindowHandle(Symbol(),Period()),lpRect))
{if(!clicked && prevcursor==cursor && click<0 && pci[3]>lpRect[0]+5 && pci[3]<lpRect[2]-42 && pci[4]>lpRect[1]+5 && pci[4]<lpRect[3]-21)
{clicked = true;
result = true;
XY[0] = pci[3]-(lpRect[0]+5);
XY[1] = pci[4]-(lpRect[1]+5); }
WindowSize[0] = (lpRect[2]-42) - (lpRect[0]+5);
WindowSize[1] = (lpRect[3]-21) - (lpRect[1]+5); }
if(click==0) clicked = false; 
prevcursor = pci[2]; }
return(result); }
bool XY2PriceBar(int XY[],int Size[], double& PriceTime[])
{int PXperBar = (Size[0]/WindowBarsPerChart()/2)*2;
if(PXperBar<1) PXperBar=1;
int Clicked_Bar = WindowFirstVisibleBar() - NormalizeDouble((XY[0]-0.0)/PXperBar,0);
double PXperPoint = Size[1]/((WindowPriceMax()-WindowPriceMin())/Point);
double Clicked_Price = NormalizeDouble(WindowPriceMax() - XY[1]/PXperPoint*Point ,Digits);
if(Clicked_Bar<0) Clicked_Bar=0;
PriceTime[0] = Clicked_Price;
PriceTime[1] = Clicked_Bar;
if(PriceTime[0]>Point && PriceTime[1]>EMPTY) return(true);
else return(false);}

///////////////////////////////////////////////////////// 

 

3ammary
348
3ammary 2012.04.14 05:03  

task completed ,,

   
         //logic of x1 button
         if(WindowSize[0]-XY[0]>500 && WindowSize[0]-XY[0]<540 && XY[1]<29) ///adddddddd
           {
             click=0;
              continue;
            }
           //logic of x3 button
       if(WindowSize[0]-XY[0]>450 && WindowSize[0]-XY[0]<490 && XY[1]<29)  ///aass
           {
             click=11;
              continue;
            }
     //logic of x5 button
      if(WindowSize[0]-XY[0]>400 && WindowSize[0]-XY[0]<440 && XY[1]<29) ///adddddddd
           {
             click=14;
              continue;
            }
           //logic of x7 button
              if(WindowSize[0]-XY[0]>350 && WindowSize[0]-XY[0]<390 && XY[1]<29) ///adddddddd
           {
             click=17;
              continue;
            }
            //logic of x9 button
              if(WindowSize[0]-XY[0]>300 && WindowSize[0]-XY[0]<340 && XY[1]<29) ///adddddddd
           {
             click=20;
              continue;
            }
             //logic of x11 button
              if(WindowSize[0]-XY[0]>225 && WindowSize[0]-XY[0]<285 && XY[1]<29) ///adddddddd
           {
             click=23;
              continue;
            }
           //logic of x13 button
              if(WindowSize[0]-XY[0]>150 && WindowSize[0]-XY[0]<210 && XY[1]<29) ///adddddddd
           {
             click=26;
              continue;
            }
            //logic of x15 button
              if(WindowSize[0]-XY[0]>75 && WindowSize[0]-XY[0]<135 && XY[1]<29) ///adddddddd
           {
             click=29;
              continue;
            }
            //

 

onewithzachy
2271
onewithzachy 2012.04.14 14:11  
could any one please help me assigning each button to its task ,, thanks in advance - MQL4 forum
  • www.mql5.com
could any one please help me assigning each button to its task ,, thanks in advance - MQL4 forum
To add comments, please log in or register