Thread: Christmas EA
View Single Post
  #3 (permalink)  
Old 12-03-2008, 04:43 AM
latimeria latimeria is offline
Member
 
Join Date: Jul 2008
Posts: 43
latimeria is on a distinguished road
I revised some codes so that you can manually set prices for the top and bottom of the tree.
It makes easy to change tree height taller or shorter and place it at the corner of the chart (not to obstruct your trade) .
I also added codes to draw it automatically at the center of the chart.

Replace extern variables to the following.

PHP Code:
extern string  PERIODExp "<<< Auto Mode >>>";
extern bool    AutoHeight true;
extern int     PERIOD 100;

extern string  CenterExp "<<< Auto Draw tree at the center >>>";
extern bool    DrawTreeCenter true;

extern string  ManualHeightExp "<<< Manual Height >>>";
extern double  TreeTop_Price 1.3;
extern double  TreeBottom_Price 1.25;

extern string  BarShiftExp "<<< Manual BarShift >>>";
extern int     BarShift 100
And replace the codes where EA defines Top and Bottom of the tree to the following.

PHP Code:
   double TreeTop TreeTop_Price;
   
double TreeBottom TreeBottom_Price;

   if(
AutoHeight)
   {
      
TreeTop LowPERIOD ];
      
TreeBottom Close[0];
      if(
TreeTop TreeBottom
      {
         
TreeTop Close[0];
         
TreeBottom HighPERIOD ];
      }
   }
   
   
int Base BarShift;
   if(
DrawTreeCenterBase WindowBarsPerChart()/2
How to set tree height manually:
change AutoHeight to "false" and input prices for the top and bottom of the tree.

How to set Barshift (where to draw a tree) manually:
change DrawTreeCenter to "false" and input BarShift (shift from current bar).

Last edited by latimeria; 12-03-2008 at 05:29 AM.
Reply With Quote