English

## need the formula of standerd deviation ....... please

 9 batttot 2015.01.24 17:57   hi all i tried to write  my EA using Standard Deviation channel  but  i cannot  find any index  for  it's  lines only  time  points  but i need  price pointsplease  i  want   the  formula  and  the  equation  that  used  to  draw this  tool  on meta trader  to be able to write  my own indicator and my EA
 2017 gooly 2015.01.24 18:04 #   I think google will give you all you need.
 9 batttot 2015.01.24 18:21 #   no my friend  i already searched  for hours  i know  the formula of  standard deviation  but  i need  the  formula or the  equation that  used  to draw this channel in  meta trader  i want to know  how  to draw  the middle line i mean  depending on what prices  ????....... what  is the equation  of it  and  what is the equation  of the deviated  upper and lower lines  ???if  you  could  found  such a thing  pleas  give me the link or type the equations  ...
13000
WHRoeder 2015.01.24 18:27 #

 batttot: i tried to write learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.

 9 batttot 2015.01.24 19:34 #   i think you didn't understand my problem  i don't  want  any one to code  my EA ...... no sir  i  want the equation of  specific meta trader tool called  standard deviation channel  any way i  think this     EA  will explain the problem this  is EA i tried to code  and  as you see  i need  to complete  the trading conditionsnow  i think my problem is  well  explained  ........... can any one  help in this ????  ``` extern int magicn = 2013;   extern int slippage = 30; extern double lotsize = 0.1; extern double takeprofit = 20; extern double stoploss = 50; extern bool close_on_revers_signal =true; extern bool Use_trailling = true; extern double TrailingStop = 20; extern double USD_Profit= 100; int TrailingStep,TrailingProfit; double i; double pt=1; double x;   int uptrend; int downtrend; //+------------------------------------------------------------------+ //| expert initialization function                                   | //+------------------------------------------------------------------+ int init()   { //----             if (Digits == 3 || Digits == 5) pt = 10; else pt=1; //----    return(0);   } //+------------------------------------------------------------------+ //| expert deinitialization function                                 | //+------------------------------------------------------------------+ int deinit()   { //----    //----    return(0);   } //+------------------------------------------------------------------+ //| expert start function                                            | //+------------------------------------------------------------------+ int start()   { //----   double arrow_down   = iCustom(Symbol(),0,"arrow",0,1); double arrow_up     = iCustom(Symbol(),0,"arrow",1,1); double arrow_down2  = iCustom(Symbol(),0,"arrow",0,2); double arrow_up2    = iCustom(Symbol(),0,"arrow",1,2);    if( arrow_up < Low[1]&& arrow_up!=0&& arrow_up2==0  &&  IsOrderOpened() ==false && lastorderclosedbuytime() ==false) { uptrend=1;downtrend=0;    //////////////========================================================////// //////////// here is the problem ////////////// if( Close[1]> ////standerd deviation channel upper line  ////////////       )    { if(close_on_revers_signal==true)    {    for( int i0 =OrdersTotal();i0>=0;i0--)    {     OrderSelect(i0,SELECT_BY_POS,MODE_TRADES);     if(OrderSymbol()==Symbol()&&OrderMagicNumber()==magicn  && OrderType()== OP_SELL)      {      OrderClose(OrderTicket(),lotsize,OrderClosePrice(),slippage*pt,Red);      }     }    }   int buyticket=OrderSend(Symbol(),OP_BUY,lotsize,Ask,slippage*pt*10,Ask-(stoploss*pt*10*Point),Ask+(takeprofit*pt*10*Point),"Batttot_EA",magicn,0,Green);   } }   if (arrow_down> High[1]&&arrow_down!=0 && arrow_down2==0 &&  IsOrderOpened() ==false && lastorderclosedselltime() ==false)   {uptrend=0;downtrend=1; //////////////========================================================////// //////////// here is the problem ////////////// if( Close[1]< ////standerd deviation channel lower line  ////////////       )    {     if(close_on_revers_signal==true)     {     for( int i3 =OrdersTotal();i3>=0;i3--)     {      OrderSelect(i3,SELECT_BY_POS,MODE_TRADES);      if(OrderSymbol()==Symbol()&&OrderMagicNumber()==magicn  && OrderType()== OP_BUY)       {       OrderClose(OrderTicket(),lotsize,OrderClosePrice(),slippage*10*pt,Red);       }      }     }    int sellticket =OrderSend(Symbol(),OP_SELL,lotsize,Bid,slippage*pt*10,Bid+(stoploss*pt*10*Point),Bid-(takeprofit*pt*10*Point),"Batttot_EA",magicn,0,Red);   } if(Use_trailling == true)TrailingStopp(); //----    return(0);   } ```
 13000 WHRoeder 2015.01.24 22:50 #   batttot: please ....please .........please  read the code  again ```if( Close[1]< ////standerd deviation channel lower line  //////////// ```I don't need to read the code again. No where in it do you try to compute the STDev. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem. gooly: sigh.I googled, for another forum and there a link of how to calc. standard deviation:How To Calculate Standard DeviationUnnecessary.Get the mean iMA - MQL4 DocumentationGet the STD iStdDev - MQL4 DocumentationUpper = Mean + STD Lower = Mean - STD. Done.
 9 batttot 2015.01.25 08:05 #   WHRoeder: batttot: please ....please .........please  read the code  again I don't need to read the code again. No where in it do you try to compute the STDev. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem. gooly: sigh.I googled, for another forum and there a link of how to calc. standard deviation:How To Calculate Standard DeviationUnnecessary.Get the mean iMA - MQL4 DocumentationGet the STD iStdDev - MQL4 DocumentationUpper = Mean + STD Lower = Mean - STD. Done.first .. thank you for  your help second:this is simple EA code  to  do what you suggested ```int start()   { //----          double mov  =iMA(Symbol(),0, 24,0,0,0,1);         double std= iStdDev(Symbol(),0,24,0,0,0,1);         double upper= mov+std;       double lower=mov-std;            Comment(mov,"==",upper,"==",lower); return(0);   }```as  you see  in the comment the  prices are  completely different from the  standard deviation  channel  tool found in  meta trader the  solve you suggested  only creates  channel  around moving average not  channel of  standard deviation that  found  in meta trader it self  .............