objective function returning wrong values

Posted By: anissyo

objective function returning wrong values - 05/13/21 10:12

Hello every body, some times i just want to hit my head against the wall be cause of some features that i just can't figure out:

here is my problems and thnk's in advance for your response :
1) when i use WinTotal/LossTotal the value is some time >1 when the system is losing a tons of money

2) for debugging purposes i try to get dollard amount of WinTotal and LossTotal but there is no way to get it, all i get is some weird numbers like this : '0.01' or '0.04' or '0.02' i guess it's the result of a ratio but there is nothing on the docs explaning what this ratio is ...

3) here is my objective function that return value supérior to 1 when the system is massively losing money when backtesting :

Code
var objective()
{
	return WinTotal /LossTotal;
}
Posted By: anissyo

Re: objective function returning wrong values - 05/13/21 11:04

after futher digging i found this sentence : "In [Train] mode the parameters are based on trades with 1 lot, including phantom trades." in the documentation, so if i understund well the results of WinTotal and WinTotal are arround '0.01' be cause all the trades are oppened with lot=1 (my lotAmount and PIPcost are extremely tight to allow a precise calculation of trade size), i think it's not an accurate way to train a strategy ... if the train mode dont repesct the money management then it's useless, i really appreciate if any one can correct my undestrunding or point me to a direction to allow the traine mode to use the Risk parameter
Posted By: jcl

Re: objective function returning wrong values - 05/17/21 07:11

Believe me, you don't want to "respect the money management" when training strategy parameters. But if you still feel the urge, dig further in the manual and you'll find out how to do that at your own risk.
Posted By: anissyo

Re: objective function returning wrong values - 05/25/21 02:30

thank's for the advice JCL

I have one question please, i use this objective function :

Code

var objective()
{

print(TO_LOG," NumWinTotal+NumLossTotal : ");
print(TO_LOG,sftoa (NumWinTotal+NumLossTotal, 6));

	return NumWinTotal+NumLossTotal;
}





i get two different values beetween the lines i get in zorro when optimizing and in the text_log, the values in the test log are correct it's the exact number of trades but when trainning i get different result on the window of zorro where the objective resuts are showing

thank's in advance
Posted By: anissyo

Re: objective function returning wrong values - 05/25/21 03:58

FINALLY !! i get it : "In [Train] mode, trades always open 1 lot, phantom trades are converted to normal trades, and MaxLong/MaxShort have no effect."

i found this on the manuel, i think it's better for me to keep it this way, it's very clever to ignore MaxLong/MaxShort, it's a robust way of doing trainning.

i was having different result be cause multiple trades are oppened in training but not when i click test
© 2024 lite-C Forums