Australian (ASX) Stock Market Forum

MetaTrader EA Programmer Needed

Joined
Jun 18, 2015
Posts
3
Reactions
0
Hi,

I have a system that I would like programmed into a EA. I have a base code complete but need some further help as I do not have this expertise.

I am happy to discuss payment for time or sharing the code once complete.

I am based in Brisbane, Australia and ideally would like find someone locally that could help. Manually trading the strategy has produced over 300% profit since January 2015.

Meta trader code is similar to C++ and knowledge of this language is transferable.

Many thanks,
Darran
 
Joined
Oct 26, 2008
Posts
2,931
Reactions
1
Re: EA Programmer MetaTrader Needed

Can you describe what functionality you are missing and what you need help with?

If you can, and one of my existing EAs has something you need (e.g. position sizing logic, time of day trading, etc), I'm happy to share it for free.
 
Joined
Jun 18, 2015
Posts
3
Reactions
0
Re: EA Programmer MetaTrader Needed

it is based around a straightforward moving average cross. the problem I have is with the entry price and timing of the entry.

everything else in the programming seems to be working correctly.

the entry price needs to (x) pips plus the fast MA and valid for the chart period ie 60 mins on a hourly chart. if not triggered the entry order needs to be cancelled and moved to a new price (x) pips plus the fast MA, and so on ...

this programming is beyond me and I do not know how to add this into the current EA. would you be interested in helping me or do you know anyone that could? :)
 
Joined
Oct 26, 2008
Posts
2,931
Reactions
1
Re: EA Programmer MetaTrader Needed

it is based around a straightforward moving average cross. the problem I have is with the entry price and timing of the entry.

everything else in the programming seems to be working correctly.

the entry price needs to (x) pips plus the fast MA and valid for the chart period ie 60 mins on a hourly chart. if not triggered the entry order needs to be cancelled and moved to a new price (x) pips plus the fast MA, and so on ...

this programming is beyond me and I do not know how to add this into the current EA. would you be interested in helping me or do you know anyone that could? :)
Is this what you are after (approximately)?

This EA:
* Waits for the open of each new bar
* Closes any open positions which go against the MA cross
* Closes any open buy or sell stops
* As long as no other positions are open, opens a buy stop at "trigger" distance above the fast MA if fastMA > slowMA
* As long as no other positions are open, opens a sell stop at "trigger" distance below fastMA if fastMA < slowMA
* No stoploss or takeprofit orders are employed.
* No position sizing or compounding is employed and the order volume is set to "0.1" lots.

Where trigger is currently set to 10 pips (adjustable).

I hacked it together from a few breakoutEAs I use for testing purposes, on a computer without MQ4 installed so it may have some minor syntax errors but should be otherwise fine.

Code:
//+------------------------------------------------------------------+
//|                                                      macross.mq4 |
//|                                        Copyright � 2015, sinner- |
//|                                               https://sina.id.au |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015 sinner-"
#property link      "https://sina.id.au"

//Params
double spread = 0.0002;
double slippage = 0.0002;
double trigger = 0.001;
double fastperiod = 10;
double slowperiod = 30;

//State
double cmd;
int cnt; 
double fast;
double slow;

bool newBar()
{
   static datetime lastbar;
   datetime curbar = Time[0];
   if(lastbar!=curbar)
   {
      lastbar=curbar;
      return (true);
   }
   else
   {
      return(false);
   }
}

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{  
//----


   ////////////////////////
   if(!newBar()) return(0);
   ////////////////////////
   
   
   ////////////////////////
   fast=iMA(NULL,0,fastperiod,0,MODE_SMA,PRICE_CLOSE,1);
   slow=iMA(NULL,0,slowperiod,0,MODE_SMA,PRICE_CLOSE,1);
   ////////////////////////
   
   ////////////////////////
   //ORDER MAINTENANCE
   for(cnt=OrdersTotal();cnt>=0;cnt--) {
   
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      
      ////////////////////////
      if( OrderSymbol()==Symbol() ) {
         cmd=OrderType();
         
         if(cmd==OP_BUY){
            if(fast < slow) {
               OrderClose(OrderTicket(),OrderLots(),Bid,slippage,Blue);
            }
         }

         if(cmd==OP_BUYSTOP){
            OrderClose(OrderTicket(),OrderLots(),Bid,slippage,Blue);
         }     

         if(cmd==OP_SELL) {
            if(fast > slow) {
               OrderClose(OrderTicket(),OrderLots(),Ask,slippage,Red);
            }
         }

         if(cmd==OP_SELLSTOP){
            OrderClose(OrderTicket(),OrderLots(),Bid,slippage,Red);
         }     
      }
      /////////////////////////
      
   }
   ////////////////////////
   
   ////////////////////////
   //BUY
   if(fast > slow && OrdersTotal() < 1) {
      OrderSend(Symbol(),OP_BUYSTOP,0.1,fast+trigger+spread,slippage,0,0,NULL,11,0,Blue);
   }
   
   //SELL
   if(fast < slow && OrdersTotal() < 1) {
      OrderSend(Symbol(),OP_SELLSTOP,0.1,fast-trigger,slippage,0,0,NULL,21,0,Red);
   }
   ////////////////////////
  
//----
   return(0);
}
//+------------------------------------------------------------------+
 
Joined
Jun 18, 2015
Posts
3
Reactions
0
Re: EA Programmer MetaTrader Needed

hi

this is along the right track. would you be interested in helping me get my strategy running?

where are you based?

diginn


Is this what you are after (approximately)?

This EA:
* Waits for the open of each new bar
* Closes any open positions which go against the MA cross
* Closes any open buy or sell stops
* As long as no other positions are open, opens a buy stop at "trigger" distance above the fast MA if fastMA > slowMA
* As long as no other positions are open, opens a sell stop at "trigger" distance below fastMA if fastMA < slowMA
* No stoploss or takeprofit orders are employed.
* No position sizing or compounding is employed and the order volume is set to "0.1" lots.

Where trigger is currently set to 10 pips (adjustable).

I hacked it together from a few breakoutEAs I use for testing purposes, on a computer without MQ4 installed so it may have some minor syntax errors but should be otherwise fine.

Code:
//+------------------------------------------------------------------+
//|                                                      macross.mq4 |
//|                                        Copyright � 2015, sinner- |
//|                                               https://sina.id.au |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015 sinner-"
#property link      "https://sina.id.au"

//Params
double spread = 0.0002;
double slippage = 0.0002;
double trigger = 0.001;
double fastperiod = 10;
double slowperiod = 30;

//State
double cmd;
int cnt; 
double fast;
double slow;

bool newBar()
{
   static datetime lastbar;
   datetime curbar = Time[0];
   if(lastbar!=curbar)
   {
      lastbar=curbar;
      return (true);
   }
   else
   {
      return(false);
   }
}

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{  
//----


   ////////////////////////
   if(!newBar()) return(0);
   ////////////////////////
   
   
   ////////////////////////
   fast=iMA(NULL,0,fastperiod,0,MODE_SMA,PRICE_CLOSE,1);
   slow=iMA(NULL,0,slowperiod,0,MODE_SMA,PRICE_CLOSE,1);
   ////////////////////////
   
   ////////////////////////
   //ORDER MAINTENANCE
   for(cnt=OrdersTotal();cnt>=0;cnt--) {
   
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      
      ////////////////////////
      if( OrderSymbol()==Symbol() ) {
         cmd=OrderType();
         
         if(cmd==OP_BUY){
            if(fast < slow) {
               OrderClose(OrderTicket(),OrderLots(),Bid,slippage,Blue);
            }
         }

         if(cmd==OP_BUYSTOP){
            OrderClose(OrderTicket(),OrderLots(),Bid,slippage,Blue);
         }     

         if(cmd==OP_SELL) {
            if(fast > slow) {
               OrderClose(OrderTicket(),OrderLots(),Ask,slippage,Red);
            }
         }

         if(cmd==OP_SELLSTOP){
            OrderClose(OrderTicket(),OrderLots(),Bid,slippage,Red);
         }     
      }
      /////////////////////////
      
   }
   ////////////////////////
   
   ////////////////////////
   //BUY
   if(fast > slow && OrdersTotal() < 1) {
      OrderSend(Symbol(),OP_BUYSTOP,0.1,fast+trigger+spread,slippage,0,0,NULL,11,0,Blue);
   }
   
   //SELL
   if(fast < slow && OrdersTotal() < 1) {
      OrderSend(Symbol(),OP_SELLSTOP,0.1,fast-trigger,slippage,0,0,NULL,21,0,Red);
   }
   ////////////////////////
  
//----
   return(0);
}
//+------------------------------------------------------------------+
 
Top