Grid maker 1.1 - page 5

 
as a PS to my previous post:

If u do use GridMaker, you will see that it accumulates open orders. In order to avoid having lots of useless open orders (u dont need a buy 500 pips away from the current rate!), please run the following script periodically to remove all open unfilled orders.

By setting the flag "allSymbols" to false, it will only remove the orders for one symbol.

This will make our MT friends soooo happy !!

PS This is a script so put it with the other scripts in the /script folder

//+------------------------------------------------------------------+
//|                                               RemoveAllGrids.mq4 |
//|                                            Copyright © 2005, hdb |
//|                                       http://www.dubois1.net/hdb |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, hdb"
#property link      "http://www.dubois1.net/hdb"
//#property version      "1.2"

extern string GridName = "Grid";
extern int    uniqueGridMagic = 11111;   // Magic number of the trades. must be unique to identify
extern bool   allSymbols  = true;        // If true, this will remove ALL grid open orders, otherwise just the pair associated with the graph

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {

 #property show_inputs              // shows the parameters 

//---- 
  int total = OrdersTotal();
  int i ;
  
      for(i=total-1; i>=0;i--)
 
      {
        OrderSelect(i, SELECT_BY_POS);
        int type   = OrderType();

        if ( (OrderSymbol()==Symbol() || (allSymbols == true)) && ( (OrderMagicNumber() == uniqueGridMagic) || (OrderComment() == GridName)) )  // only look if mygrid and symbol...
        {
          bool result = true;
          if ( type > 1 )  result = OrderDelete( OrderTicket() );
    
          if(result == false)
          {
     //       Alert("Order " , OrderTicket() , " failed to close. Error:" , GetLastError() );
     //       Sleep(3000);
          }  
        }
      }
 
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
Lastly, for today, here is an update of the grid statistics for the week:


Balance       110k     ( start 49k)
Equity        53k      (start 49k)
Margin used    26k
Available      26k
Open P&L      -57k



The balance increases by 2k to 4k per day with .1 lots, 6 pip grid, 12 pip TP, 11 currencies.

The Equity is in the money this week really for the first time since the trial started on may 18th. I do hope it stays this way!

The open P&L gets out of hand as the USD goes up and other pairs come down...a 200 to 300 drop in the Euro will probably wipe the account clean...


Over the last 4 weeks, I have been looking for ways to reduce drawdown. For 2 weeks I have used the limitEMA34 flag, longs and shorts and the useMACD flag. This seems to be working but I would like to see a sharp strong drop to test this scenario.

I have attempted a lot of backtests using MT4 but I am not satisfied with the results.. there are too many anomalies in the test results for me to have confidence in them...

To summarise, based on the demo results, here are my conclusions:

1) small grids are better
2) a mix of currencies is better
3) doubling the TP relative to the grid size has significantly improved returns
4) using the EMA and MACD as guides, the drawdown seems to be slowed down and there does not seem
to be a significant impact on return. However, I cannot quantify this for now.

ok, enough.. good trading all!!

 
I would like to double check on which time frame the gridmaker v1.8 expert should be attached to?
 
Pip,

From the code, it appears that it is not important unless you make use of the EMA or MACD flags.. in which case my guess is 5 mins is the minimum.. just try different time periods.

Best regards,

Hugh
 
In backtesting the grid I can't ssem to get it to enter into any buy trades. It only does sell trades. Everything is set correctly in the settings. Is it supposed to do this. I am using MT4 latest build.
 
ElCapo,

In my experience, this type of EA does not back test well and I have seen some real strange results. I now always test longs, shorts and both as three different tests to make sure that both is the sum of longs and shorts (off course, if the strategy implies it should).

Try a forward test for a few days.. I'm sure you will get both longs and shorts.

Best regards,

Hugh
 
I think it's wrong to give direction judgment.
So, UseMACD and limitEMA should be set false.
 
DEAR hdp

TALKING TO THE POINT, THE EA IS SO GOOD BUT I NEED SOME HELP FROM YOU IN THE CODE INSIDE THE EA?

WELL....

ON STTEING UP THE EA ON THIS CONDITIONS AS FOLLOW:

extern int uniqueGridMagic = 11111;
extern double Lots = 0.1;
extern double GridSize = 3;
extern double GridSteps = 12;
extern double TakeProfit = 30;
extern double StopLoss = 20;
extern double UpdateInterval = 1;
extern bool wantLongs = true;
extern bool wantShorts = true;
extern bool wantBreakout = true;
extern bool wantCounter = false;
extern bool limitEMA = false;
extern int EMAperiod = 34;
extern double GridMaxOpen = 0;
extern bool UseMACD = true;
extern bool CloseOpenPositions = false;

THE PROBLEM THAT I WANT IT TO BE SOLVED IS: WENE IT OPENS ORDER WITHIN THE GRIDSTEPS WITH THE GRIDSIZE UNDER THE CURRENT PRICE ON THE CHART IT PLACES ANOTHER ORDER IF THE CURRENT PRICE GO'S UP OR DOWN FOR ONE GRIDSIZE.

WHAT I WANTED TO BE OR TO BE RECODED IS:

WENE EA PLACES ORDERS WITHIN THE GRIDSTEPS NO OTHER PLACING ORDERS UNTILL THE CURRENT PRICE GO'S UP BY THE SAME NUMBER OF GRIDSTEPS OR THE CURRENT PRICE GO'S DOWN BY THE SAME NUMBER OF GRIDSTEPS, AFTER THAT THE EA PLACES ANOTHER ORDERS INSIDE NEW GRIDSTEPS DEPENDING ON THE EA CONDITIONS AND CURRENT PRICE.

IF THIS CODE IS SOLVED I THINK THE EA WILL MORE PROFITABLE
 

Very nice ea thank you for sharing. 

 

I know its an old threat but never the less its important to keep updating existing data so here we go. the key in eliminating drawdown is renko charting!

have fun! 

 
bogdandanci:

Very nice ea thank you for sharing. 

 

I know its an old threat but never the less its important to keep updating existing data so here we go. the key in eliminating drawdown is renko charting!

have fun! 

Keep us posted on how that works out for you.  It is, as you said, helpful sharing experiences and knowledge.