Crypto-city
#0

TIPS & TRICKS / FAQS 

- What i need to run C.A.T. and How can i run it?

First of all C.A.T. need java 8 official (http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html) for your operative system (Linux/Windows/Mac) and nothing more.

C.A.T. doesn't need installation : Once you have installed Java, you can simply double click che CAT.JAR File.
If JAR extension is already used by another program (for example Winrar) you can simply Right Click JAVA.JAR - Open with Java.
C.A.T. is fully portable : you can copy your full CAT Folder and move to USB/Another PC without problems.

These are che combination you can perform using C.A.T.
- Run 1 CAT Instance on 1 PC and Log on X Exchanges - For every exchange a dedicated panel will be shown.
- Run X CAT instance on 1 PC and log on Y Exchanges - For every CAT instance you will have a dedicated FRAME, for every exchange logged for any instance you will have a dedicated panel (for example you can run 2 CAT instance and log on 3 exchange for instance 1 and 1 exchange for instance 2)
- Same combination as before but using different PC : You can run CAT on your Mac and another on your Windows PC.

Try to avoid : 
- Run more than 1 CAT instance from the same folder : CAT 1 and CAT 2 will works on the same files. Only few of them could have a collision, but General Console LOG and CAT_LOG (the one create in CATSystemFolder) are 2 files where collision could happens.
Solution is simple : if you want to run X CAT Instance, then create X CAT Main folders.
- Run 2 CAT Instance and log on the same Exchange.
This could cause bad behaviours (2 examples)
- if you launch a "DELETE ALL ORDERS" from CAT 1 then CAT 2 could have big problems.
- the NONCE (a progressive number always increased) API parameters could have collision : CAT 1 and CAT 2 could calculate same Nonce - Exchange will refuse one of the 2 calls.

- How Does a Ping-Pong Cycle Work?

In a Ping-Pong cycle there are some factors involved : 
- The User who wants to create orders
- The automatic Ping-Pong Algorithm
- The Exchange Trading system that match buyers/sellers orders

A Ping is an order of Buy or Sell Type. In case of Dynamic Algoritm is free to move (automatic-recreation if needed) according to the ping-pong algorithm parameters (ex : price limits)
A Pong is an order of Sell or Buy Type (Opposite from the original Ping type). It is created by CAT after a Trade occurs over a Ping.
The difference between Ping and Pong is that Pong have 1 more attribute that restrict the possibility about price movements and order recreation : the Reference Price.
The reference price is the price of the Trade Occurs over the Ping.
The Pong price is calculated considering Ping Trade Price + % Gain Requested By The User + Current Market Price.
Calculated price must guaranteed at least the % Gain set by the user.

This is the workflow of a Ping Pong Order. Loop is INFINITE (but of course you can set stop conditions).
USER Can Anytime Add Orders or Edit The Buy/Sell Pool.

- Buy/Sell Pool (Automatic)/Ping-Pong Order Creation (User) - Ping - TRADE (Reference Price) - Pong (At least % GAIN) - GAIN - TOTAL (Minus Fees) IN BUY/SELL POOL
and then loop restart

Explanation with Examples (for explation simplification without considering FEES and User Parameters) : 

Buy/Sell Pool : Values are expressed as , partner is the currency wich you express the Price (or Total Value)
Example : on BTC/LTC, LTC is , BTC is
Every Pool Lookup (that could occurs ever X lookups) CAT will try to use 100% of the Pool to create a new Order.
Buy Pool to create new Buy Orders
Sell Pool to create new Sell Orders
You can limit this behaviours setting Pool Limits about Qty and Pool Activations conditions.

A simple example (without considering limits and user parameters) : 
Sell Pool 0.3 BTC, Best Market Sell Price is 0.00013 - 0.3/0.00013 = 2307 new QTY - New Sell Order will be Sell 2307@0.00013
BUY Pool 0.01 BTC, Best Market Buy Price is 0.00012 - 0.01/0.00012 = 83 new QTY - New Buy Order will be Sell 83@0.00012

Now a Trade Occurs over your Order Sell 2307@0.00013
Let's say it's a partial trade : Sell 1500@0.00013
We consider a Gain of 5%  
So, REFERENCE PRICE Is 0.00013 - 0.00013 - 5% (In case of Sell Pong it will be REFERENCE PRICE + % GAIN) = 0,0001235 New Pong Price
So New Order Pong will be Sell 1500@0.0001235

When a Trade Will Occurs Over the Pong You will have a GAIN expressed by CAT as 
- % (percentage difference between price) 
and
(Total Orders Difference - (Buy + Sell Fees))

The TOTAL Value (Qty x Price) could be reuse (100% or Part of it) into the Buy/Sell Pool to create new PING ORDERS.

In a Ping-Pong Cycle, each order will have his indipendent "life"
Partial trades will generate more ping and more gains.

Example : 

Ping Sell 1000@X 
Trade 1 Sell 500@X - PONG T1 Buy 505@Y
Trade 2 Sell 300@X - PONG T2 Buy 303@Y
Trade 3 Sell 200@X - PONG T3 Buy 202@Y

PONG T1 Buy 505@Y
Trade 1 Buy 200@Y - 1 LINE OF GAIN in Gains Table
Trade 2 Buy 305@Y - 1 LINE OF GAIN in Gains Table.

In this example, from 1 PING, 3 PONGS Are generated, and from 1 PONG 2 GAINS are generated.
Usually this happens when you have very BIG Ping Orders.

CAT will proportionally Calculate PING Fees According to Final Pong Trades.
On Final Pong Trade "Trade 1 Buy 200@Y" CAT will calculate the % Percentage of the original  Ping "Trade 1 Sell 500@X" Fees.
Example : 
Ping Buy 100@X - Total Fees is 0.01
If a Final Pong will be Buy 10@X (that is 10% Qry of the original Buy) Total Fees From Ping will be 0.001 (10% of 0.01)

PING-PONG Schema



This is the Infinite Ping-Pong cycle. This is a simplified view, but it's useful to understand how flow work.
User can update/change elements but the most important actions are :
- Add a Ping Using the GUI Interface
- Update the buy/Sell Pool Values.
Ping Pong parameters works over the Ping-Pong workflow : 
Example : 
- Price limit works on Ping (by default, but you can also add a Limit on Ping)
- Stop Loss rules works on Pong
- Reuse Rules works on Trades From Pong
- Merge rules works on Ping/Pong/Trades From Ping
When you have a clear idea about ping-pong cycle it will be easier to understand WHERE you need to set your parameters to optimize your ping-pong algorithm

- How often C.A.T. will check markets?
Every 40 Seconds (for each markets) a Lookup is performed.


- How is calculated the % DIFF?
Percentage difference is calculated via this formula : (price1 - price2) / price2 * 100;
Where price1 could be from : Best Market Sell Order or Order Reference or New Value Calculated By C.A.T.
Where price2 could be from : Best Market Buy Order or Order Reference or New Value Calculated By C.A.T.

Ex : 
Best Buy Price VS Best Sell Price (is the CHECK Button Result in Ping Pong Creator)
Reference Price VS New Order Price Calculated (In case of BUY Order)
New Order Price Calculated VS Reference Price  (In case of SELL Order)


- How can i Choose Best Markets to Run PING-PONG?
A single answer doesn't exists. It depends on your strategy. Be aware of these factors : 

- In "low fluctuation" markets,  markets with high and similar number of trades in last 24 hours, it's easy to have a lot of successful Ping-Pongs.
Example of "High And Equilibrate in terms of 24H Trades" : 500/550 - 300/400 - 400/600 .....

- % Min Gain have his meaning for each market. 
Ex : 
LTC/BTC
Best Sell : 0,025
Best Buy : 0,0249
Difference is : 0,0001
% Difference is : 0,4% 
 
DOGE/BTC
Best Sell : 0,00000111
Best Buy : 0,00000110
Difference is : 0,00000001
% Difference is : 0,9% 

So, choosing 1% for LTC/BTC could be a good idea, choosing 1% For DOGE/BTC could be a bad idea.

- Study the MAX Value & MIN Value of markets during 24/48/72 hours. The number of times that market hits MAX-Y and MIN+Y (A window of value where you know that many times/day you will reach that value).
Place a Buy when Market is near MIN+Y, place a Sell when Markets is Near MAX-Y
Set a % difference near % Diff Between MIN and MAX

- You don't need to have a lot of Ping-Pong cycles completed to make money with C.A.T. You can have 1 Ping-Pong/Day but with enormous Gain. Some markets move +/- 30% in a 24 hour period.


- What can i do for Market Devaluation?
- During a general market devaluation phase you will lose money. Stop using CAT if you don't have time to study markets and choose the ones to work on. 
- After you stop using CAT you will notice that you will lose money the same. (Because it's not C.A.T.'s fault when you loose money)
- A manual Sell of some currencies in BTC could be a good idea.


- How does the "Skip Order With Total < Than" work?>
This command, when activated, will be the first operation that C.A.T. will do before any other check
Example (BTC/LCT Market) : 
 

TOP 6 SELL ORDERS
0.02354986   6.68382294   0.15740309
0.02354988   0.04345361   0.00102333
0.02354989   0.03050035   0.00071828
0.02354990   5.74587878   0.13531487
0.02354992   1.27806294   0.03009828
0.02354993   0.54047313   0.01272810
other orders....
 
TOP 6 BUY ORDERS
0.02340506   0.03000000   0.00070215
0.02340157   1.21655125   0.02846921
0.02330005   4.00000000   0.09320020
0.02330003   0.09000000   0.00209700
0.02330002   0.01098146   0.00025587
0.02330001   101.20393854 2.35805278
other orders....


If you set Skip Order With Total < Than 0.1 this will be the "filter" result : >  

TOP SELL ORDERS
0.02354986   6.68382294   0.15740309
0.02354990   5.74587878   0.13531487
other orders....
 
 
TOP BUY ORDERS
0.02330001   101.20393854 2.35805278
other orders....


So, BEST Sell Price Order will be 0.02354986 and BEST Buy Price Order will be 0.02330001


- Does the % GAIN That C.A.T. calculates include market fees?
Orders all have fees. And the % calculated are with fees included.
So you must calculate that there is always a 0.X% fee on a buy order and 0.X% fee on a sell order.
C.A.T. doesn't pre-calculate fee but is able to know fees quantity after a trade, and subtract them from the total amount used for new Pong Orders or New Ping Orders From buy/sell Pool


- How does the Ping-Pong Algo Work?
This happens every 40 seconds and all the steps are not always completed.
- Check Pending User Operation (request like delete orders or stop process)
- Update last time lookup (this is useful to detect frozen condition)
- Check if there's at least 1 active order or a trade or a buy-sell pool value (if not, market will be in ZOMBIE status)
- Check Run Condition (if there's some option active like Return All To Primary/Secondary Currency)
- Update (With Api Call) Market Orders+MyOrders+MyTrades
- Check Orders To Restore (orders that in previous lookup got errors)
- Check Each Active Order (if a trade is happening, if there are condition to retry a recalculation to place order in better market condition)
- Check Each Trade to create New Pong Order (if Trade From Ping) or to add total trade value into Buy/Sell Pool (if Trade From Pong)
- Check if there are new Ping Orders to create from Buy/Sell Pool (this happens every 5 lookup)

- Is my Estimated Portfolio Value Accurated?
No it is not.
Estimated portfolio value is only the sum of all your Coins, converted to BTC using the LAST ORDER PRICE.
This means that if you have 10 Coins X, and this is the Order Book:

Price Quantity 
0.05   0.02
0.04   0.1
0.03   0.1
0.02   0.1
0.01   0.1
0.005   500

And the last trade is Buy 0.02@0.05, your Estimated Value will be 100 * 0.05 = 0.5 BTC
Your Real Portfolio Value is the distribution of your 100 Coins over the book order.

So : 

0.05 * 0.02 + 
0.04 * 0.1 + 
0.03 * 0.1 + 
0.02 * 0.1 + 
0.01 * 0.1 = 

0,001+0,004+0,003+0,002+0,001 = 0.011 Total Value distribute on the value of the first 5 orders.
Quantity distribute is 0.42, it will remain  9.58 to distribute over the last order (500@0.005) = 9.58 * 0.005 = 0,0479

Your ESTIMATED Value is 0.5 BTC 
Your REAL Value is 0.011 + 0.0479 = 0.0589 BTC