Username: Password:

Author Topic: Wally's Cointracking hacks for gunbot  (Read 4304 times)

Offline cw

  • Trust: (+1)
  • Novice
  • *
  • Posts: 44
    • View Profile
    • Gunbot University
Wally's Cointracking hacks for gunbot
« on: June 09, 2017, 06:56:46 AM »
Howdy all -


First, be sure to take a look at criptonauta's most excellent and full review of Cointracking here on the forum.  He did a great job giving a tour of a most common reports a gunbotter might want.  We share what we know about Cointracking because A) the more gunbotters use it, the more likely we'll get features we all want, B) if you use our discount links, we also get a referral fee, and C) we're a helpful community.

If you've followed the telegram chat group at all, you may have seen me post my coin graphs every once in a while:


or


and said "where are those pictures from?"  And then I said "They are from Cointracking!" and then I'd go into a little spiel and demo about how much I depended on Cointracking for all my tracking because of all I do with cryptocurrency beyond just one gunbot instance with one exchange.

In this post I'm going to show some of the things I do with Cointracking- both built-in and not built-in - that help me make the most of gunbot specifically.



I'd like to be upfront about discount codes - I love Cointracking a lot, and I absolutely could not manage all the cryptocurrency work I do without it, but I do receive a referral fee when people use my discount code.  You get a 10% discount when you use my discount code. You also get a 5% discount when paying with BTC.  Cointracking is a subscription service - there is a free plan for up to 200 trades, a 1yr plan a 2yr plan and a "lifetime" plan.  There is a "pro" and an "unlimited" plan. 

I strongly encourage you to try out the free plan to at least play with it.  Please use my referral link when you try it out.  You can upgrade later.  You'll get your discount(s) when you check out. 

https://cointracking.info?ref=C937652

Ok, let's get into the hacks.



LET COINTRACKING ENTER YOUR TRADES AUTOMATICALLY FOR YOU

Let's go over some things you want to set up to make gunbotting a lot easier - API importCointracking supports API import of all three exchanges that gunbot supports - Poloniex, Kraken and Bittrex.  At this time, Cointracking will only automatically import once a day, so you will need to manually "nudge" it if you want to load trades more often.  The maximum you can nudge it is once an hour.

I have this on automatic pilot now - if it's been more than an hour since I've visited Cointracking, I just go to Enter Coins --> Automatic API Imports --> Bittrex, then I select the API "check now", then I go to Kraken, then I go to Poloniex.  I actually run at least two accounts each, so I've got at least two API's for each set up.  I've tried a couple of times to set up a cron job with wget/curl to go and fetch (click) the "check now" button, but I don't have it quite right yet, as I run into the Incapsula robots detection bug so once I figure that out I'll post it. 

API import tip: the more API imports you have, the longer it might take to import coins.  Shocker, I know.  Sometimes the exchanges take a while (1-2 minutes) to respond to Cointracking's request to download the trades.  If you don't have a busy bot and only have one exchange, then this won't take very long.  If you have 6 accounts with 10+ trades per hour, then be patient.



SEE IF A COIN IS ACTIVELY TRADING OR NOT

There's this really cool report that is hard to find if you don't know where it is:




This can be found in Charts & Trends --> Coin Charts, then type in a coin name and press the >> button.  Let it draw the chart, and then click the "Show my trades [beta]" button near the top.


This report not only helps to show if trades are active -- ie, if there are buys and sells going on, but also what the volume of those trades are relative to the bitcoin and USD value at the time. The larger the circle, the bigger the buy or sell.

The blue area is the BTC value, so as it rises and falls, so does the relative BTC price.  Likewise, as the red line rises and falls, so does the USD price.  Most of the time, these are mostly in line, but sometimes they differ.  In the above graph, you can see how the USD line is at or below the BTC line. 

Now take a look at a coin that gunbot is not actively trading - here is a coin that I'm manually trading.


First thing to notice is that I made a relatively large buy of BITB on May 29th at a low price, and I made two sales of BITB on June 5th.  One tiny sell and one medium sell.  It looks like I timed it just right because I sold it right before it started going down.  I guess I'm just lucky.

The second thing to notice is the red USD line is mostly above the blue BTC area for this coin rather than below it like LSK.  That might be worth remembering if we ever get to doing arbitrage (trading coins between other currencies) or if we care about a coin's value in something other than bitcoin.



WHAT PROFIT AM I MAKING IN A COIN ANYWAY?

In the last section, I pointed out a manual trade that showed up that had some decent profit.  What if I wanted to know more about that coin, and how I'm doing with it?  How is BITB doing?  Is it a profitable coin for me?


  • Go to Reporting --> Trade Analysis
  • Drop down your coin from the "Coin pair" at the top.  Note that if you trade with a funding currency other than BTC such as if you do ETH_xxx or XMR_xxx on polo, or something else on Kraken or Bittrex, then you'll need to change BTC first, and then drop down the coin
  • (optional) You can filter the trade analysis to just one exchange if you'd like.
  • (optional) If you just want to look at a specific date range, say if you've changed your configuration (ALLPAIRS) or upgraded your gunbot version, and sold your bags and want to see how the changes affected your profit outlook, maybe you'd like to change your date range.

I've followed the steps, and selected BITB / BTC pair, so let's look at my report:


Now let me tell you what I look at in the report, in order.

  • First things first - I like money.  I first look to see PROFIT/LOSS - is this positive?  In this report, I see 0.1887xxxxx BTC is my profit, so this is a very good thing.  That's a lot of profit, especially since my cost was 0.037 BTC (notice it says "Total cost" just two lines above).  Now, it's important to know that "total cost" isn't same as "original cost"  I'll get to that later.  But if I get nothing else from this report - I at leas know that BITB is a profit-maker for me - 0.188 BTC NET PROFIT is good!  The second thing I'll notice in this #1 section is "current value" - this means that I currently own 0.15 BTC worth of this coin.  That might be important to know, especially if the market is volatile, or if I "need" this "money". 
  • The second section I look at is the purchases, sales and difference.  This tells me how many coins I actually have - here, I have 71 thousand BITB because I originally bought a little over 100k and I've sold 30k.
  • Next I look over to the left and I see the avg buy price (70 satoshis - very low), the avg sell price (360 satoshis, thankyouverymuch), and the current market price (213 satoshis).  This lets me know I did a good job of selling some of my stash.  I bought low, I sold high while it was high, and the market is down from the high.
  • In the fourth section, I see the reverse timeline of all the trades.  I picked BITB because it was simple - only three trades.  The report lists my original buy of 101,000 coins where I spent about 0.07 BTC on a coin that was only 70 sat each (very cheap coin).  Then it lists a sell of 20,000 coins about a week later where I got all my original investment of 0.07 BTC back plus a little more, but I only had to sell one fifth (1/5) of the coins.  Then I sold a few more coins just to make some more profit.
  • Section 5 is where I just check the dates, exchange or other info.

Other useful pieces in the Trade Analysis is the search, entries dropdown and export - same as many other sections of Cointracking.



WHAT CAN COINTRACKING HELP ME DO MYSELF?

Sometimes Cointracking doesn't do everything you need right out of the box.  For example, I'd really like to see an hourly graph of trades by Exchange:


Or my new updated version:



What I'm going to show you is how I use what Cointracking gives me to make something of my own.  You only have to do this preparation work once - it will take you maybe 10-15 minutes the first time, depending on how familiar you are with Excel or spreadsheets... and then about 2 minutes each time you want to update it (30 seconds once you get the hang of it).

For this specific tutorial, I'll assume you have Microsoft Excel.  If you do not, what I'm doing isn't specific to Excel, so you can duplicate the same steps in the spreadsheet of your choice.

When you run multiple exchanges (or even when just running one), it's very valuable to see how many trades are actually executing... not just how many gunbot is issuing.  In the gunbot logs, we only know how many gunbot sends to the exchange.  We don't know how many actually get executed.  For example, gunbot may send one sell order.  The exchange may process ZERO sell orders or may process FIVE sell orders.

Now, you may ask - if Cointracking doesn't provide this report, why am I listing it here?  Well, Cointracking is collecting all this valuable trade data from all these exchanges for me, and it's a relevant report. 


On the Enter Coins --> Overview & Manual Input screen, Cointracking gives you all the info you need.   Navigate there.  Then put your Table View into "Extended mode" if not already in that mode.  (NOTE: if you have more than 10,000 trades, you may have to choose to be in Server Side Processing mode vs Client Side Processing mode.  This impacts how easy it is to download these trades into excel.   CSP mode can go straight into Excel but if your browser can't process that many trades, you'll need to use a different mode and that's more advanced than this tutorial covers).

Then click Export and select Excel.  Open that up the first time.  You'll see that you get 11 different columns of information. 


First, we need to add two new columns - "L" and "M"

In cell L1, type "Datefield" and in column M1 type "Time"

Then in cell L2, type in the following formula:

Code: [Select]
=DATEVALUE(LEFT(K2,10))

and for M2, use the following formula:
Code: [Select]
=LEFT(K2,13)

Make the entire column L into format "Date" and entire column M into format "General" if not already.

This should make L2 turn into a real date and M2 turn into text that is the date plus the two-digit hour.


Then, as shown in the graphic, select both L2:M2 cells together and drag the bottom right handlebar of M2 and drag that handlebar down so that it fills in the same formula down to all your trades.  Keep dragging until it reaches your last trade.    Excel is smart and will speed up if you have a long way to go and slow down when you're reaching the end.

One thing I like to do is change the name of the worksheet (aka "tab") from "Sheet1" to "Trades".  That way I know what I'm working on.

Now we create the pivot chart.
  • Select any cell inside the list of trades in the spreadsheet.
  • Insert a pivot table.  In Excel 2010, this is Insert --> PivotTable.  Accept the defaults of "New Worksheet".


  • You'll have a blank pivot table to start filling in.  In the Field List picker on the right, drag Type down to Report Filter, Exchange to Column Labels, Time to Row labels and Currency to Values.  It should look like this at first over in the Field list picker:


  • The table on the left will have your exchanges as columns, and dates/hours as rows and just a bunch of numbers in the middle.  We don't care about them yet.  We want to make a graph.
  • Click in the Pivot Table it created and click insert PivotChart.  This might be in the Insert menu or PivotTable Tools depending on your version.  I'm using Excel 2010 so I'll use PivotTable Tools --. PivotChart and select Area Stacked Area


  • Now you'll have a small chart that doesn't really look good or help anyone.  That's ok because we will fix that.


  • Resize the graph to whatever size makes it work for you.  But an hourly graph probably should be filtered to just a few days.  So you can filter this by dropping down the triangle next to "Row Labels" in the table on or near cell A4 or the "Time" dropdown in the lower left hand corner of the graph.  Since this isn't a real date, you can't do things like say "after 6/1/2017" but you can type in a date and filter like that.


  • So for example you can type in 2017-06-08 and it will auto-select that date for you and just select that date. Press ok and you will only have the hours of that day selected. If you drop down the triangle next to "Row labels" again and type in another date, you can check the "add current selection to filter" and it will not replace the previous selection.
  • Once you've narrowed down your dates, your graph should look much more readable.
  • If you want to see daily trades instead of hourly, go back to your Field List picker on the right and drag Time back up to the field list and drag Datefield down


  • Notice above that I dragged "time" field out of Row labels on the right side back up to the list of fields, then I dragged "datefield" out of the list of fields and I put it into the row labels section.  This automatically made a nice graph of # of DAILY trades per exchange instead of HOURLY.
  • This also means I can filter by date instead of hour

Notice that it created a new worksheet (tab) called Sheet2.  I would rename this "Pivot" or something different that Sheet2.

Now, you don't want to have to go through all of the above again every time you update cointracking with your trades.  So save your excel spreadsheet locally.  Next time cointracking gets updated, when you open up the excel spreadsheet from the cointracking download, just do this:

  • Open the cointracking download
  • Click any cell inside the newly downloaded data
  • press CTRL-A to select the table of data and CTRL-C to copy the entire table to clipboard
  • Go to your previously saved trades spreadsheet you created before - remember we renamed it from Sheet1 to Trades?  That's the tab I'm talking about.  Go there and click in cell A1 and PASTE.  This will update all your trades.
  • IMPORTANT - we need to update your formulas, so go to your columns L and M, and scroll all the way to the bottom and see where columns L and M start being empty and column K is still filled in.  This is where you want to select cells L & M and drag the handle down to fill the formula down to any new trades that got brought in.
  • Now go to your Pivot tab, right-click anywhere in your Pivot Table and select refresh.  This will update the table and your chart.

That's it!  Now your daily/hourly chart has been updated with the trades that cointracking went and fetched for you.

For the updated column type of graph, instead of Stacked Area graph, make the graph type Stacked Column.  I did a number of customizations on the graph I posted above that may or may not interest you - I list a couple below.

  • The date axis format is changed by right-clicking the axis --> format axis, then Number, then custom, then putting in Format code: "ddd m/d"
  • Widening the column width is done by right-clicking one of the columns --> format data series, then moving the "Gap Width" slider all the way to the left.
  • Adding the "grand total" numbers at the top of the bars is a little more work, but I really like the effect.  I'm not going to describe all the steps here, but you can google for the instructions or look at this link or this link for some tips.




WHICH OF *MY* COINS ARE BEING AFFECTED IN THE MARKET RIGHT NOW

Those of you who like to use market cap or volume to choose coins probably know about http://coincap.io or http://coinmarketcap.com.  Those are good sites to use.  Cointracking has similar info, charts and useful information to help you research your coins.  For some, it can link to the website for the coin itself.

This is found under Charts & Trends --> Coin Trends


However - what's really helpful here is that you can limit this to your own currencies - that is powerful.  You can see how your own portfolio is impacted by the market's movers and shakers.

Here's how I use this on a regular basis:
  • If my portfolio total is going up, I'll go here, then click "Only currencies I own", then sort by "trend 24h" so that I see green on top.  I'm looking to see what in my portfolio is having the highest profit right now.  Why?  I might want to go take advantage of some profit taking!
  • If my portfolio total is going down, I'll go here, then do the same thing and click "trend 24h" again to see red on top.  This shows me the biggest coin losers.  This helps me see which coins are dumping.  Why?  This may help me see if I need to change gunbot settings.  Maybe I need to look out for security margin.

After this report, I typically go to Reporting --> Current Balance.

This is an extremely similar report, in that it has 24h, 7d and 30d trend, but instead of volume and basics like coin and price in USD on it's own column, it has MY coin amount, MY value in USD and MY value in BTC.

The main reason I use this report is to sort the report by BTC value and see how my main holdings are gaining or losing.

  • Are any of my top holdings losing big?
  • How about winning?  Do I need to maybe try to shave some good profits?  For example, if I'm holding 50 different coins, but I see 75% profit in my #3 coin, should I go act? (probably so!)
  • Am I diversified enough?



I will update this post as I have time to document those things that I use on a day to day basis to help me with gunbot-specific tasks.
« Last Edit: September 04, 2017, 01:43:31 AM by cw »

Cointracking affiliate link (10% discount for you) https://cointracking.info?ref=C937652

Offline criptonauta

  • Local Moderator
  • Trust: (+19)
  • Contributor
  • ****
  • Posts: 126
  • Escrow - Licenses - Consulting - Best reputation
    • View Profile
Re: Wally's Cointracking hacks for gunbot
« Reply #1 on: June 09, 2017, 07:11:03 AM »
Fantastic job and effort put in this great review and tutorial. Thank you very much for sharing it! I'm gonna make my sheet right now!

+1

Gunbot licenses 10% off: 'Criptonauta_Gun' code. | Tuning, Custom Strats | No VPS? Get yours here

Offline Kruste

  • Trust: (0)
  • Rookie
  • *
  • Posts: 13
  • be strong to be useful
    • View Profile
Re: Wally's Cointracking hacks for gunbot
« Reply #2 on: June 25, 2017, 08:40:16 PM »
Thx for the Guide!

I just purchased one year with your code.

Had contact with the support team last night (Yeah, they even contacted me on Saturday night  ::) ) about showing the daily profit in BTC and %.
They say, that they are working to do so. For now itīs possible to get a daily mail with it.
Also it is possible to show the portfolio in a different way as described here https://cointracking.info/feedback.php to only show the Profit/Loss without Fiat or deposit/withdraw.
For now this has to be done manual, but they are working on a solution to get it working with automatic API integration also :)

Also they are working on the mobile App to get more details in it :)

Offline cw

  • Trust: (+1)
  • Novice
  • *
  • Posts: 44
    • View Profile
    • Gunbot University
Re: Wally's Cointracking hacks for gunbot
« Reply #3 on: June 27, 2017, 10:32:51 PM »
Thx for the Guide!
I just purchased one year with your code.

I appreciate that, Kruste - I will continue to update the hacks as I find more items that are of interest to botters, including new features that regularly get updated.  I've suggested several new features that will help us.

Quote
Had contact with the support team last night (Yeah, they even contacted me on Saturday night  ::) ) about showing the daily profit in BTC and %.
They say, that they are working to do so. For now itīs possible to get a daily mail with it.

They are indeed quite responsive and one of the most supportive services out there.  Well worth the subscription price.

Quote
Also it is possible to show the portfolio in a different way as described here https://cointracking.info/feedback.php to only show the Profit/Loss without Fiat or deposit/withdraw.
For now this has to be done manual, but they are working on a solution to get it working with automatic API integration also :) Also they are working on the mobile App to get more details in it :)

That is good to know and I'll be on the lookout. 

Cointracking affiliate link (10% discount for you) https://cointracking.info?ref=C937652

Offline LenardBang

  • Trust: (0)
  • Rookie
  • *
  • Posts: 6
    • View Profile
Re: Wally's Cointracking hacks for gunbot
« Reply #4 on: August 26, 2017, 11:17:00 AM »
Trying to follow up this nice guide, but the pictures are missing, which makes it a little bit harder. Any chance You could readd the pictures mate? please :)

Offline cw

  • Trust: (+1)
  • Novice
  • *
  • Posts: 44
    • View Profile
    • Gunbot University
Re: Wally's Cointracking hacks for gunbot
« Reply #5 on: September 04, 2017, 01:25:57 AM »
Trying to follow up this nice guide, but the pictures are missing, which makes it a little bit harder. Any chance You could readd the pictures mate? please :)

It wasn't the post - the entire gunthy site itself was having problems. None of the pictures anywhere were displaying.  Looks like everything is showing up now.

Cointracking affiliate link (10% discount for you) https://cointracking.info?ref=C937652

Offline cw

  • Trust: (+1)
  • Novice
  • *
  • Posts: 44
    • View Profile
    • Gunbot University
Re: Wally's Cointracking hacks for gunbot
« Reply #6 on: September 09, 2017, 10:47:26 PM »
And here's another little thing I've been working on, with relation to things you can do with Cointracking info.   Cointracking currently doesn't give a profit report on a Coin's trades... one that takes into account gunbot's buys and sells and what the profit ends up being, with or without fees. 


This actually is quite difficult, due to a few factors:
  • Gunbot may place multiple buy orders.
  • The exchange may split gunbot's buy order into multiple orders.
  • Gunbot may place multiple sell orders.
  • The exchange may split gunbot's sell order into multiple orders.
  • A gunbot order may end up being partially filled.
  • A gunbotter may decide to WallyBag their coins - ie, move their coins to another account and free up gunbot to work at a new price.  This may confuse the boughtPrice since it's moved to another account.

So I came up with some spreadsheet logic to take cointracking export and make this graph.  I'm working on a tool for Gunbot University subscribers but wanted to at least show a screenshot to show people what was possible with Cointracking data.

Cointracking affiliate link (10% discount for you) https://cointracking.info?ref=C937652

Offline cw

  • Trust: (+1)
  • Novice
  • *
  • Posts: 44
    • View Profile
    • Gunbot University
Re: Wally's Cointracking hacks for gunbot
« Reply #7 on: September 18, 2017, 11:21:55 PM »
One thing I wanted to point out is that the author of CoinTracking frequently provides new features on a very regular basis.  It feels as if a week doesn't go by without a new feature or enhancement being added to the service.  Most subscription services barely have updates every YEAR, much less every week or so.

Here's a sample of features added in a short period of time:


You can go to https://cointracking.info/new_features.php to view these new features.  The site even separates these out as New Features, Improvements and Bugfixes if you want to see them separately.

Cointracking affiliate link (10% discount for you) https://cointracking.info?ref=C937652

Offline cw

  • Trust: (+1)
  • Novice
  • *
  • Posts: 44
    • View Profile
    • Gunbot University
Re: Wally's Cointracking hacks for gunbot
« Reply #8 on: September 21, 2017, 09:28:44 PM »
The features keep coming.  Here are a couple new announcements made by Cointracking recently:


API Exchange Balance (Live Data)

The first one is "API Exchange Balance (Live Data)" which is also available at https://cointracking.info/import/balance/ if you want to bookmark it.   If you're looking to actually see your live balances at the exchanges and compare them to what Cointracking has added up with all the trades, this is a great way to do that.

The nice thing about this as well is that you can have multiple API keys connecting to different accounts at the same exchange - for example, if you have multiple Bittrex accounts - one for Manual trading, and one for gunbot for "horizontal trading" and another one for gunbot for "pump and dump" you can see those separately.


This supports all sorts of exchanges, not just the ones Gunbot works with.

Note that you need to make sure you enable the right permissions.  For example, if you use Kraken but don't enable "Funds - Query Funds" you will get an error like this:


As of the time of this writing, this feature supports the following exchanges: Bitfinex, Bitstamp, Bittrex, Coinbase, Cryptopia, Gatecoin, GDAX, Kraken, Liqui, Poloniex, TheRockTrading, Tidex, Yobit, Binance, Bitcoin.co.id, Bleutrade, Livecoin

Results are cached for 60 seconds. This is a non-cached result (live data).

You must set at least these API permissions to use the page:

Yobit: info only
Liqui: Info
Bitstamp: Account balance
Tidex: Info
Bitfinex: Wallet Read
Bittrex: Read Info
Coinbase: wallet:accounts:read
Kraken: Funds - Query Funds




« Last Edit: Today at 05:21:03 AM by cw »

Cointracking affiliate link (10% discount for you) https://cointracking.info?ref=C937652

Offline cw

  • Trust: (+1)
  • Novice
  • *
  • Posts: 44
    • View Profile
    • Gunbot University
Re: Wally's Cointracking hacks for gunbot
« Reply #9 on: October 11, 2017, 06:07:08 PM »
Another CoinTracking feature that Gunbot users will enjoy:


Those of you who use Cryptopia exchange will want to auto-import your transactions via API into CoinTracking and since they've recently updated their API import, CoinTracking has updated theirs as well.


Notice that with CSV import, you do NOT get deposits and withdrawals... but with the API import, you **do**.  This is important if you want to keep your CoinTracking balances as accurate as possible.
« Last Edit: October 11, 2017, 06:19:47 PM by cw »

Cointracking affiliate link (10% discount for you) https://cointracking.info?ref=C937652

Offline cw

  • Trust: (+1)
  • Novice
  • *
  • Posts: 44
    • View Profile
    • Gunbot University
Re: Wally's Cointracking hacks for gunbot
« Reply #10 on: October 19, 2017, 08:46:20 PM »
Here's another CoinTracking tip  for Gunbotters -- there are Notifications on the main dashboard that will tell you about new transactions that were imported.


At this time, this is the closest we'll get to a time tracker of how often we get new transactions.  In this set of notifications, I see I'm doing fairly well - in the span of just one day, I got 36 new transactions, 70 transactions and 17 transactions (top 3 notifications).  The next 4 transactions show 22, 1, 83, 13 and 60 transactions, so that totals to a decent number of transactions from Bittrex, depending on how many pairs I'm running.

You may ask yourself - wait a second, Wally!  Cointracking only imports API transactions once per day... how do you have multiple imports throughout the day?  Well, I bookmark the "nudge" link from CoinTracking on my phone, so when I feel like it, I just "nudge" CoinTracking to fetch the API transactions.  It lets me do that as often as once per hour.


I made one bookmark for each exchange and each API key.  Each link is the orange "check now" box from "Your running Bittrex jobs" sections on the API Import page. 

It looks like this:

Code: [Select]
https://cointracking.info/import/bittrex_api/check.php?j=118&check=check
but will be your specific link and your specific api.  Once you bookmark it and label it, it's very easy to hit it whenever you want.


Cointracking affiliate link (10% discount for you) https://cointracking.info?ref=C937652