Advertisement
Parkinwad
Nov 2nd, 2022 (edited)
33
0
Never
This is comment for paste trade.js
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. This is for long positions only.
  2. Changes made from original:
  3. line 31 was edited from "getPrice" to "getAskPrice"
  4. line 32 was added for sell side of transaction to be accurate
  5. line 44 was changed to .askPrice from .price
  6. line 56: changed .price to .askPrice and added commission to printout calculation.
  7. 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.
  8. line 97: changed ".price" to ".bidPrice" to properly show the profit if stock is sold during that cycle.
  9. line 109: changed ".price" to ".askPrice"
  10. 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