Hello,
I'm really excited to see this metric!
I was able to get it working using the provided workspace.
I then tried to get my own workspace working but the Custom Fitness Value is always 0 and I'm not sure why.
My custom workspace has a data1 and data2, 5 min bars for 5 years.
The !optimize! signal is the last and status is on, "Custom 1 Line" works and shows the equity.
Thinking it maybe something in EquityCurveStdDev
Code: Select all
Input: CalculateRatio(TrueFalseSimple) {final calculation};
if CalculateRatio then begin
array: equty_per_bar[](0);
var: intrabarpersist last_idx(0);
for value1 = maxpositionsago downto 0 begin
value3 = PosTradeCount(value1)-1;
for value2 = 0 to value3 begin
last_idx += 1;
array_setmaxindex(equty_per_bar, last_idx);
equty_per_bar[last_idx] = PosTradeProfit(value1, value2);
//print( "trade [", maxpositionsago - value1, ",", value2, "] = ", equty_per_bar[last_idx]);
end;
end;
EquityCurveStdDev = StandardDevArray( equty_per_bar, last_idx, 0 );
// if 0=getappinfo(aioptimizing) then print( "EquityCurveStdDev = ", EquityCurveStdDev );
end;
Or StandardDevArray
Code: Select all
inputs:
PriceValueArray[MaxSize]( numericarray ),
Size( numericsimple ),
DataType( numericsimple ) ;
Value1 = VarianceArray( PriceValueArray, Size, DataType ) ;
if Value1 > 0 then
StandardDevArray = SquareRoot( Value1 )
else
StandardDevArray = 0 ;
Thanks in advance.