ethanopp / gsheets-3c-portfolio-manager Goto Github PK
View Code? Open in Web Editor NEW3C Portfolio Manager
License: MIT License
3C Portfolio Manager
License: MIT License
Since this is versioning so fast and is a bit annoying to keep generating API keys / deleting sheets we need a function to pull this and delete the sheet.
This would use the document / script properties to find the "last risk manager sheet" and delete it.
Then using user properties we can pull the api keys and populate into the new script.
Need to see if we can make sure the old triggers are cleared as well.
Pushing more than 5000 rows locks up the Google sheet entirely. Working on building a way to push the data in 1000 row chunks after it's pulled from the API, or as the data comes in.
Keep in mind the 5M limit.
Right now the handler limits at 5k deals. 3Commas returns oldest deals first. This means if you have 10k deals to look at, the dashboards focus on most recent deals but you only get to see the oldest deals.
We essentially need to query all deals and drop the first set up to 5k or find a way to get 3C to query on dates only.
It would be relatively easy to create a bot manager sheet that enables users to modify settings of their bots and push to 3Commas. This would need to be a SEPARATE api key that only has bot access, and something that needs to be toggled on or copied completely independently. Just to keep people trusting the sheet. All the code base is already there to do this.
Time commitment: 1-2 hour project
Idea to enable:
Shows metrics related to total overall performance.
Showing the performance of your portfolio daily
We may be able to make this into a formula that accepts days back from today as a date filter sort of. The query would still be required to fetch ALL deals from the API and then make calculations based on this.
Easy to calculate. Each deal's close date just pull the hour and give profit by hour converted to local timezone. Not an essential chart but fun to look at to see when the most volatile times are.
Calculating how good each pair does based on the calendar day. This could be fed into a line chart showing total profit by pair by day.
https://discord.com/channels/720875074806349874/835100061583015947/851237071389589525
Build summary accounts table with reserved field customization.
We need the ability to select ALL currency and have this update across the sheet. Right now it's doing this based on a selection change
// Store sheet name in instructions H1 for query reference
function onSelectionChange(e) {
const prop = PropertiesService.getScriptProperties();
const previousSheet = prop.getProperty("previousSheet");
const sheetName = e.range.getSheet().getSheetName();
if (sheetName != previousSheet) {
SpreadsheetApp.getActive().getRange("Instructions!H1").setValue(sheetName);
}
prop.setProperty("previousSheet", sheetName);
}
Add to OnEdit. When you edit a sheet with the denomination or account, it pulls that data off the sheet and stores it in a script property.
We create a account_id
, currency
, and AccountName
custom function for GAS. These can populate data in the instructions sheet
Build out integrating grid bots into the API calls and a sheet tab. This will be used to calculate risk and on the summary analysis tabs.
Total grids * amount per grid
API call example
{
id: 5
account_id: 10
account_name: 'My account'
is_enabled: true
grids_quantity: '20'
created_at: 2018-08-08 08:08:08
updated_at: 2018-08-10 10:10:10
lower_price: '8000'
upper_price: '10000'
quantity_per_grid: '100'
leverage_type: 'custom'
leverage_custom_value: '20.1'
name: 'GridBot1'
pair: 'BTC_ETH'
start_price: '9000'
grid_price_step: '100'
current_profit: 100
current_profit_usd: 1000
bought_volume: 1000
sold_volume: 1000
profit_percentage: 0.1
current_price: 100.1
investment_base_currency: 100
investment_quote_currency: 100
grid_lines: GridLineEntity
}
This would require adding step % from the API on the deals table, then creating a calculated metric for max drawdown % and handling once it hits 100%.
It might be best to move the whole Drawdown (query)
table to the backend to be calculated as an active deals table to merge tables together.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.