Skip to content
This repository has been archived by the owner on May 12, 2019. It is now read-only.

Bug in TotalProfitCriterion? #194

Closed
CCob opened this issue Sep 11, 2017 · 3 comments
Closed

Bug in TotalProfitCriterion? #194

CCob opened this issue Sep 11, 2017 · 3 comments

Comments

@CCob
Copy link

CCob commented Sep 11, 2017

I'm not sure if TotalProfitCriterion's behavior is correct.

https://github.com/mdeverdelhan/ta4j/blob/master/ta4j/src/main/java/eu/verdelhan/ta4j/analysis/criteria/TotalProfitCriterion.java#L65

It seems to be getting it's exit and entry price of the trade from the close price for the Tick and not the entry and exit price of the order itself.

Now whilst back testing, this is not a real issue since the order price is chosen as the close price of the tick anyway so the values are one the same.

But I have been forward testing with ta4j and there is a discrepancy where I'm actually using the bid/ask cost to enter/exit an order which gives different results vs TotalProfitCriterion.

Thanks

@CCob
Copy link
Author

CCob commented Sep 12, 2017

After further investigation there appears to be many of the Criterion classes all using the close price of the index the trade occurred instead of looking at the price of the order within the entry and exit trade. So for forward testing I'm guessing a whole set needs to be made or they need to be adjusted to look at close price or actual order price?

@dpalic
Copy link

dpalic commented Sep 15, 2017

This repository was dropped See #192
Could you please repost your question there? https://github.com/ta4j/ta4j

@mdeverdelhan
Copy link
Owner

Yes, criteria often use the close price and not your actual entry/exit price. Please use https://github.com/ta4j/ta4j/issues for further discussion.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants