Optimizing Sample 1
Previous  Top  Next

In this example we step through the process of optimizing the OMX_Sample1 strategy. This is a simple moving average crossover strategy. The code for it is shown here:

 
inputs:  
   Len1( 15 ),  
   Len2( 20 );  
 
if AverageFC( c, Len1 ) crosses over AverageFC( c, Len2 ) then  
   buy next bar at market ;  
if AverageFC( c, Len1 ) crosses under AverageFC( c, Len2 ) then  
   sell all shares next bar at market ;