Before you go, check out these stories!

0
Hackernoon logoCreate Your Own Custom Calculation for Trading Crypto like a Pro [feat. the Crypto-Exchange I Built] by@binaryoverdose

Create Your Own Custom Calculation for Trading Crypto like a Pro [feat. the Crypto-Exchange I Built]

Custom calculations have just arrived in the latest update of Binary Overdose the realtime cryptocurrency analysis software, let's take a look.

Custom calculations are simple yet very powerful. Essentially itโ€™s the ability to create brand new columns based on data from other columns.

A simple example would be if we loaded โ€œVolume USDโ€, a column that shows data in full units, we could then create a custom column called โ€œVolume Millions USDโ€, divide the previous column by 1 million and hide the original.

Of course there are many more advanced use cases than this and weโ€™ll get into some later in this article.

Volume Weighted Market Cap

To weigh volume as a metric we can multiply it by the market cap. The lower the volume, the lower the overall score.

  1. Open theย binaryoverdose.comย website and click on โ€œEditโ€.
  2. On the bottom right of the dialogue click โ€œClear Selectionsโ€.
  3. Now open the CryptoCompare menu item in the left panel and select both โ€œVolume 24h $โ€ and โ€œMarket Cap $โ€.
  4. On the right panel at the bottom click โ€œAdd Customโ€.
  5. Give the custom column a name, letโ€™s say โ€œVolume Weighted MCโ€.
  6. There should only be 2 available options in the columns selector marked โ€œstep 2โ€. Select both of them. Note that the order you select them in will define which variable name they get assigned, eitherย 
    c0
    ย orย 
    c1
    .
  7. Now in the calculation text box (step 4 in the graphic) write the followingย 
    c0*c1
    ย and click the โ€œOKโ€ button.

We could clean this up a little as the number is really quite big. Change the calculation toย 

(c0*c1)/1000000
, make sure the type is set to number and update the title to say โ€œVolume Weighted MC Millionsโ€, now we have something we can actually use.

Hereโ€™s one I made earlier:
Volume Weighted MC Live Example

And hereโ€™s a quick YouTube example:

Code repo points to market cap ratio (RPMC Ratio)

Letโ€™s do another simple one before we work on a more complex example. To create this new ratio we need to divide code repo points by market cap.

Follow the previous steps again but select the โ€œcode repo pointsโ€ and โ€œmarket capโ€ columns instead, you can search for them if you donโ€™t want to navigate the menu tree.

Now instead of multiplying the values just divide them. Make sure you divide Market cap by Code Repo Points though as this time the order does matter.

In the example I sorted by the new โ€œRPMC Ratioโ€ field in ascending order as lower numbers are better. I also added a couple of filters, โ€œMarket Cap > 100000000โ€ and โ€œRPMC Ratio > 0โ€ just to filter out some junk.

Hereโ€™s an example:ย BinaryOverdose Code Repo Points Market Cap Ratio.

A complex Custom Ranking System

For the next example weโ€™re going to create a custom ranking system. Let's say weโ€™re trying to value cryptocurrencies based on our own criteria. To do so weโ€™ll pick a number of metrics that were interested in and assign them points between 0 and 2.

Weโ€™ll then add up the points and sort the column in descending order.

At the risk of not overly complicating this example weโ€™ll only pick 3 data points, โ€œNumber Of Exchangesโ€, โ€œSharpe Ratio 30 Dayโ€ and โ€œ7 Day Change Against BTCโ€.

Hereโ€™s the calculation. It may look complicated at first but there is only one thing you need to know and its repeated 6 times.

(
  c0 == 0
    ? 0
    : c0 < 5
      ? 1
      : 2
)
+
(
c1 > 5
    ? 2
    : c1 > -1
      ? 1
      : 0
)
+
(
  c2 > 0
    ? 0
    : c2 > -2
      ? 1
      : 2
)

Firstly, theย 

c0
ย ,ย 
c1
ย andย 
c2
ย variables are assigned automatically as in the previous example. For this calculation they are as follows:

c0 = Exchanges
c1 = Sharpe Ratio
c2 = 7 Day Change

The โ€œcโ€ stands for column if you were wondering.

Anyway, there are a maximum of 2 points assigned for each metric so a grand total of 6 max per result. A breakdown of how they are assigned is below but if you donโ€™t care you can justย go to the live example hereย (I added a few more columns at the end so our calculation wasnโ€™t lonely).

A note on the syntax (skip if you know what a ternary operator is)

In order to write the calculation weโ€™ll use a JavaScript conditional operator called theย ternary operator. It works as follows:ย 

condition
  ? expression if condition is true
  : expression if condition is false

So if the number of exchanges, lets call thatย 

c0
ย equals 4 and our expression wasย 
c0 < 3 ? 0 : 1ย 
then the result of the calculation would be 1 because 4 is not smaller than 3.

Because we require multiple conditions we will use a nested ternary operator for each calculation. It may look a little complicated but it should be no worse than an excel function (I know thatโ€™s not saying much).

Number of Exchanges Calculation

The Number of Exchanges metric is the total number of exchanges that a cryptocurrency is listed on, in this example it will be assigned the variableย 

c0
.

c0 == 0              // if c0 equals 0
  ? 0                // then 0 points
  : c0 < 5           // else if c0 is between 1 and 4
    ? 1              // then 1 point
    : 2              // otherwise 2 points

Sharpe Ratio Calculation

For Sharpe ratio generally the greater the value of the Sharpe ratio, the more attractive the risk-adjusted return.

So let's say over 5 gets 2 points, between 0 and 4 gets 1 point and under 0 gets 0 points.

Sharpe Ratio will be assigned the variableย 

c1
ย so our calculation is as follows.

c1 > 5               // if c1 is greater than 5
    ? 2              // then 2 points
    : c1 > -1        // else if c1 is greater than -1
      ? 1            // then 1 point
      : 0            // otherwise 0 points

7 Day change against Bitcoin

For this metric we are looking for projects that have recently pulled back so weโ€™ll assign more points if there has been a larger drawdown.

7 day change will be assigned the variableย 

c2

c2 > 0              // if c2 is greater than 0
  ? 0               // then 0 points
  : c2 > -2         // else if c2 is greater than -2
    ? 1             // then 1 point
    : 2             // otherwise 2 points

Donโ€™t forget to check out theย BinaryOverdoseย website and follow us onย Twitterย for updates. Leave a comment to let us know your experiences with custom calculations or if you need any help making your own. You can also check out this full feature screencast.

Full Disclosure

I (Alan), am the founder of Binary Overdose so am obviously biased as to how great it is. Stay tuned for even more powerful custom calculations coming real soon.

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.