Bitcoin Forum
May 25, 2024, 08:54:00 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Beginner looking at allgorithm trading  (Read 50 times)
groppo91 (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
April 09, 2021, 02:46:47 PM
 #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?
Tytanowy Janusz
Legendary
*
Offline Offline

Activity: 2156
Merit: 1622


View Profile
April 10, 2021, 08: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


Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!