Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
BTC sell estimator
using System; namespace Rextester { public class Program { // play with these numbers: private static float btc = 1.0f; // your starting BTC amount private static float sellInterval = 1000f; // how often you want to sell as price increases private static float startPrice = 8000f; // starting price private static float goalPrice = 25000f; // price you want to be able to sell until private static float checkInterval = 10f; // make this higher or lower if you want to be finer/coarser private static float tolerance = 0.0001f; // probably don't play with this one private static float valueEachSell = 10; // probably don't play with this one public static void Main(string[] args) { float leftOver = 0f; do { leftOver = Calculate(btc); if (leftOver > tolerance) { valueEachSell += checkInterval; } } while (leftOver > tolerance); float totalCashSold = valueEachSell * ((goalPrice - startPrice) / sellInterval); float startAcctValue = btc * startPrice; float profit = ((totalCashSold / startAcctValue) - 1f) * 100f; var output1 = string.Format("Starting with {0:0.0###} BTC and the price starting at ${1},", btc, startPrice); var output1b = string.Format("Your account would be valued at ${0}", startAcctValue); var output2 = string.Format("you can sell ${0} every ${1} until price reaches ${2}", valueEachSell, sellInterval, goalPrice); var output3 = string.Format("This will equal a total of ${0} gross proceeds.", totalCashSold); var output4 = string.Format("Your profit would be ${0} / ${1} = {2:+0.00}%", totalCashSold, startAcctValue, profit); Console.WriteLine(output1); Console.WriteLine(output1b); Console.WriteLine(output2); Console.WriteLine(output3); Console.WriteLine(output4); } private static float Calculate(float startBtc) { for (float start = startPrice + sellInterval; start <= goalPrice; start += sellInterval) { float btcSold = valueEachSell / start; startBtc -= btcSold; } return startBtc; } } }
run
|
edit
|
history
|
help
0
ds
Reflekcja assembly, instancja i metoda
MonitorPulse.cs
Trent Butler All Dead Example
n th to last element
Selected Poetry of Rumi doy/poem#
saxasd
Sugar
Jerold
Hallo world