Epilog
Previous  Top  Next

Place the following epilog code at the end of your strategy:

 
{______OMX EPILOG_______}  
   end ;  
If OMX_Init = 1 And OMX_IterationNum > 0 Then begin  
   OMX_Temp = OMX_BarInfo( OMX_EquityResolution, OMX_IterationNum ) ;  
   If OMX_LastBarInWalk Then begin  
      OMX_Fitness = Div( NetProfit, absvalue(MaxIDDrawDown) ) ;  
      OMX_Temp = OMX_EndPass( OMX_Fitness, OMX_IterationNum, OMX_FirstCalcDate, OMX_FirstCalcTime ) ;  
      end ;  
   end ;  
 

 
There are two important parts of the epilog for you to consider, BarInfo and Fitness.

BarInfo

 
OMX_Temp = OMX_BarInfo( OMX_EquityResolution, OMX_IterationNum ) ;  
 

     
In this line, you are sending information about each bar back to Optimax. The first parameter is a granularity value. If you are optimizing an intra day strategy, you can modify this parameter to control the resolution of the equity curve displayed in Optimax.

Common granularity values are:

5
report equity at 5 minute intervals
10
report equity at 10 minute intervals
100
report equity at 10:00, 11:00, 12:00, etc.
200
report equity at 10:00, 12:00, 14:00, etc.
1500
report equity daily at 3:00pm
 

Equity is reported to Optimax when mod(time,EquityResolution) = 0. The lowest equity between two granularity points will be the equity reported to Optimax.

Changes to this parameter have no effect on daily, weekly or monthly charts.
 
 
clip0008Performance Tip  
Lower resolution values increase detail within Optimax, and also decrease performance during optimization and display.  
 
 
     


Fitness

 
OMX_Fitness = Div( NetProfit, absvalue(MaxIDDrawDown) ) ;  
 

     
Fitness is the objective of your optimization expressed numerically. It is a floating-point value between -1E300 and 1E300. Positive fitness values are fit and negative values are unfit. Optimax considers higher values as fitter, and lower values as less fit. That doesn't mean you should attempt to have fitness values span the entire permissible range up to 1E300; values between 0.0 and 1.0 would work as well, given enough decimal places; it's up to you. Unfit values are excluded from mating and are not used when creating a subsequent generation.