Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in code.java, why do the for-loops on lines 867 and 935 start at 1? #12

Closed
ZDavid opened this issue Mar 20, 2018 · 4 comments
Closed

in code.java, why do the for-loops on lines 867 and 935 start at 1? #12

ZDavid opened this issue Mar 20, 2018 · 4 comments

Comments

@ZDavid
Copy link

ZDavid commented Mar 20, 2018

This would mean the first open position never closes throughout the entire simulation.

@jbglattfelder
Copy link
Collaborator

The motivation is that we never want to decascade the initial position. It is closed when the PNL condition is satisfied.

@mailfilter888
Copy link

Do you know whether the PNL takes into account the transaction costs before reaching the target? For example, if commission was $7 plus there was swap fees of $4 would it take these into account if the profit target was $10 ie the total would need to be $21 gross profit to have a net profit for the EA target of $10?

Otherwise if a position is held onto for a long period (under the model some runners could be held onto for months or years) the swap could cause the profit to be eroded or go into negative.
Thanks

@jbglattfelder
Copy link
Collaborator

jbglattfelder commented Mar 21, 2018

So this is a toy model where the only transaction fees are the spread you pay. But yes, if you hook this up to a specific exchange that charges fees, you would need to factor that in.

Note however that in the "limit orders" version of the algo you don't pay any spread fees:
https://github.com/AntonVonGolub/Code/tree/master/LimitOrders

@ZDavid
Copy link
Author

ZDavid commented Mar 24, 2018 via email

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

No branches or pull requests

3 participants