Advertisement
This is comment for paste
trade.js
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is for long positions only.
- Changes made from original:
- line 31 was edited from "getPrice" to "getAskPrice"
- line 32 was added for sell side of transaction to be accurate
- line 44 was changed to .askPrice from .price
- line 56: changed .price to .askPrice and added commission to printout calculation.
- line 60: changed profit calculation to use the bidPrice since that is what is used when a stock is sold long, thereby making the printout calculation in line 62 accurate as well. Not sure if the commission portion of that line I added is accurate. Need to check the code again.
- line 97: changed ".price" to ".bidPrice" to properly show the profit if stock is sold during that cycle.
- line 109: changed ".price" to ".askPrice"
- line 110: changed to 2 * commission in order to take into account both purchase and sale commissions when deciding profits on a stock. Won't make much of a difference TBH.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement