I have an EA that I regularly backtest and optimize. I want to determine a relationship between the probability of a given trade being profitable and a certain statistical measure called kurtosis at the time the trade was initiated.
I programmed my EA to generate a .csv file containing each trade's profit/loss alongside the proper kurtosis value.
Excerpt:
I am not interested in the discrete sum of profit/loss, so I replaced all p/l values with binary values: 1 if the trade was profitable and 0 if it was not profitable.
Excerpt:
Now what I want to do is to determine the relationship (if any).
Normally I would use a polynomial regression, but this makes no sense when one of the variables is binary.
I have read of something called logistic regression, but I can't seem to figure out how to do it with MatLab.
If someone could give me some instructions and possibly some tips on interpreting the results I would really appreciate it. If you know of another way to achieve a relation between the two variables I'd like to hear that too.
I programmed my EA to generate a .csv file containing each trade's profit/loss alongside the proper kurtosis value.
Excerpt:
Inserted Code
[b][u]PROFIT[/u][/b][b][u]KURTOSIS[/u][/b] -41.822.97530011 -61.823.12553938 -45.822.32907776 -100.821.9039837 -14.822.35415757 -30.822.23130752 -75.822.76931501 -62.821.60114237 28.183.29114443 12.182.99822995 6.182.27906841 -76.821.59931087 1.186.21691918 54.183.15778944 24.184.98645291 2.182.84275644 33.182.36483006 18.182.17924754 -160.821.86165136 51.181.90035084 ... etc
I am not interested in the discrete sum of profit/loss, so I replaced all p/l values with binary values: 1 if the trade was profitable and 0 if it was not profitable.
Excerpt:
Inserted Code
[b][u]PROFIT[/u][/b][b][u]KURTOSIS[/u][/b] 02.97530011 03.12553938 02.32907776 01.9039837 02.35415757 02.23130752 02.76931501 01.60114237 13.29114443 12.99822995 12.27906841 01.59931087 16.21691918 13.15778944 14.98645291 12.84275644 12.36483006 12.17924754 01.86165136 11.90035084
Now what I want to do is to determine the relationship (if any).
Normally I would use a polynomial regression, but this makes no sense when one of the variables is binary.
I have read of something called logistic regression, but I can't seem to figure out how to do it with MatLab.
If someone could give me some instructions and possibly some tips on interpreting the results I would really appreciate it. If you know of another way to achieve a relation between the two variables I'd like to hear that too.