Author

Topic: Beginner looking at allgorithm trading (Read 67 times)

legendary
Activity: 2156
Merit: 1622
April 10, 2021, 03:34:39 AM
#2
Hi I am a working on a small project to auto trade crypto on the binance platform hopefully automatically. I was thinking of a simple vwap and EMA to start with for indicators. Currently I have hooked up the binance-node-api and was wondering how I could go about implementing vwap calculations following:

  • Find the average price the stock traded at over the first five-minute period of the day. To do this, add the high, low, and close, then divide by three. Multiply this by the volume for that period. Record the result in a spreadsheet, under column PV.
  • Divide PV by the volume for that period. This will give the VWAP value.
  • To maintain the VWAP value throughout the day, continue to add the PV value from each period to the prior values. Divide this total by total volume up to that point. To make this easier in a spreadsheet, create columns for cumulative PV and cumulative volume. Both these cumulative values are divided by each other to produce VWAP.

can this be done or am I looking at this wrong?


Should work. You can also use code that is already developed (especially if you want to use well known indicators). No need to invent wheel for a second time.

For example this:
https://github.com/topics/vwap

https://github.com/moremeds/vwap/commit/0e0ffc196c2024ed9cfc26eca4649c83d6795102


newbie
Activity: 1
Merit: 0
April 09, 2021, 09:46:47 AM
#1
Hi I am a working on a small project to auto trade crypto on the binance platform hopefully automatically. I was thinking of a simple vwap and EMA to start with for indicators. Currently I have hooked up the binance-node-api and was wondering how I could go about implementing vwap calculations following:

  • Find the average price the stock traded at over the first five-minute period of the day. To do this, add the high, low, and close, then divide by three. Multiply this by the volume for that period. Record the result in a spreadsheet, under column PV.
  • Divide PV by the volume for that period. This will give the VWAP value.
  • To maintain the VWAP value throughout the day, continue to add the PV value from each period to the prior values. Divide this total by total volume up to that point. To make this easier in a spreadsheet, create columns for cumulative PV and cumulative volume. Both these cumulative values are divided by each other to produce VWAP.

can this be done or am I looking at this wrong?
Jump to: