Newbie EA design help

 

Hi

I have a custom indicator that I would like to automate. I have no programming skills and this has taken me a lot to get working. So now I would like it automated.. Please help!

Here is the code... for the EA

extern string Note1 = "MACTD Settings";
extern int MATCDFast=2;
extern int MATCDSlow=18;
int MATCDMethod=1;
extern string Note2 = "iSee Settings";
extern int iSeeFast=4;
extern int iSeeSlow=34;
bool iSeeUseSlow = true;
extern double LotSize = 0.01;
extern int StopLoss = 200;
extern int TakeProfit = 200;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   double isee,matcd;
   
   isee = iCustom(Symbol(), Period(), "iSee", iSeeFast, iSeeSlow, iSeeUseSlow, 1, 1);
   matcd = iCustom(Symbol(), Period(), "MATCD", MATCDFast, MATCDSlow, MATCDMethod, 5, 1);
  
   if(isee > 0)
   {
      if(matcd > 0)
      {
         int ticketBuy;
         ticketBuy = OrderSend(Symbol(), OP_BUY, LotSize, Ask,30,Bid-150*Point,Bid+250*Point, "MATCDA Order #", 23990, 0, Green);            
         if(ticketBuy < 0) 
         {
            Print("Buy OrderSend failed with error #",GetLastError());
            return(0);  
         }
      }
   }  
   else
   {
      if(matcd < 0)
      {
         int ticketSell;
         ticketSell = OrderSend(Symbol(), OP_SELL, LotSize, Bid,30,Ask-150*Point,Ask+250*Point, "MATCDA Order #", 23990, 0, Red);
         if(ticketSell < 0) 
         {  
            Print("Sell OrderSend failed with error #",GetLastError());
            return(0);
         } 
      }
   }   
//----
   return(0);
  }
//+------------------------------------------------------------------+

 For some reason its not getting into the OP_SELL part as it should. Also I would like it to open one trade at a time and wait before opening another one. I would really appreciate If someone with skills can help out.

Thank you. 

 
imaxi:

Hi

I have a custom indicator that I would like to automate. I have no programming skills and this has taken me a lot to get working. So now I would like it automated.. Please help!

Here is the code... for the EA

 For some reason its not getting into the OP_SELL part as it should. Also I would like it to open one trade at a time and wait before opening another one. I would really appreciate If someone with skills can help out.

Maybe   isee  is never less than or equal to 0  ?  what range of values do you get from buffer 1 of your iSee Indicator ?
 
RaptorUK:
Maybe   isee  is never less than or equal to 0  ?  what range of values do you get from buffer 1 of your iSee Indicator ?


I have attached an image file... have a look. iSee is a double type.

 

 
imaxi 2013.01.04 15:53 
RaptorUK:
Maybe   isee  is never less than or equal to 0  ?  what range of values do you get from buffer 1 of your iSee Indicator ?
I have attached an image file... have a look.
You should answer the question. Your image tells us nothing unless we ASSUME the line is zero AND that you are selecting the correct buffer.
 
WHRoeder:
You should answer the question. Your image tells us nothing unless we ASSUME the line is zero AND that you are selecting the correct buffer.
LOL . . .  I'm getting used to having any question I ask go unanswered.
 
WHRoeder:
You should answer the question. Your image tells us nothing unless we ASSUME the line is zero AND that you are selecting the correct buffer.


iSee is a time series forecast indi and the values are calculated form price. The order is as I say it is.. Buffer 1 equal the black line.. Which is PriceBufferMA2. The Dots on iSee are zero.. When the black line passes through the zero mark then it should be negative.

extern int Fast=4;
extern int Slow=21;
extern bool useSlow = false;


//--- buffers
double PriceBufferMA1[];
double PriceBufferMA2[];
double Buy[];
double Sell[];
 
RaptorUK:
LOL . . .  I'm getting used to having any question I ask go unanswered.

;)
 
imaxi:


iSee is a time series forecast indi and the values are calculated form price. The order is as I say it is.. Buffer 1 equal the black line.. Which is PriceBufferMA2. The Dots on iSee are zero.. When the black line passes through the zero mark then it should be negative.

OK,  add a line just after your 2nd iCustom call . . .

Comment("isee = ", isee, " matcd = ", matcd);

  . . .  then run your EA in the Strategy Tester and see if isee and match both go less than or equal to 0 at the same time.

 

To only have one order open at once,  count how many orders you currently have open for your Symbol and Magic Number and if greater than 0 don't place a new order   . . . .

 
RaptorUK:

OK,  add a line just after your 2nd iCustom call . . .

  . . .  then run your EA in the Strategy Tester and see if isee and match both go less than or equal to 0 at the same time.

 

To only have one order open at once,  count how many orders you currently have open for your Symbol and Magic Number and if greater than 0 don't place a new order   . . . .


Thank you for your time.. I will have a look and get back to you.. :)
Reason: