Previous  Top  Next

Next, prolog code must follow. A sample is shown here:

{_____OMX PROLOG________}  
If BarNumber = 1 Then begin  
if OMX_IterationNum = 0 and ( OMX_Generation = 0 or OMX_Individual = 0 ) then begin {line 3}  
Len1 = I_Len1 ; {line 4}  
Len2 = I_Len2 ; {line 5}  
else begin  
OMX_Init = OMX_InitPass( OMX_IterationNum, OMX_Generation, OMX_Individual ) ;  
If OMX_Init = 1 Then begin  
Len1 = OMX_GetParm( "Len1" ) ; {line 11}  
Len2 = OMX_GetParm( "Len2" ) ; {line 12}  
end ;  
end ;  
end ;  
If OMX_Init = 1 Then begin  
OMX_Temp = OMX_PriceModX( OMX_StreamNum, OMX_IterationNum, OMX_Generation, OMX_Individual ) ;  
end ;  
If OMX_IterationNum = 0 Or OMX_DateOk Then begin  

This code sets the values of the converted input variables used in your strategy. It will do this on the first bar of each strategy evaluation using either the values from the I_ inputs or by calling Optimax to obtain the values.

The lines highlighted in bright blue are the lines that change for each strategy. For each input, you must have two lines, one in the first section and one in the second.

Line 3 will be true when you are not optimizing causing the values for your strategy to come directly from the input variables (lines 4 and 5.)

Line 3 will be false when you are optimizing, causing the OMX_GetParm functions (lines 11, 12) to be called and the values retrieved from Optimax.

Optimax accomplishes price modulation via the call to OMX_PriceModX shown in bright blue near the end of the above code snippet.