Last active
December 23, 2017 03:35
-
-
Save umar-siddiqui/5e5aa196f141a84821707c11038e31eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in_amt_inr = 10000 # Investment amount in INR | |
cryp_inr = 69.70 # cyrpto 1 price in INR | |
cryp_btc = 0.000073 # cyrpto 1 price in USD | |
cryp2_btc = 0.019470 # cyrpto 2 price in USD | |
cryp2_inr = 18350 # cyrpto 2 price in INR | |
ex1_to_ex2_tf = 0.04 | |
conv_btc_ef = 0.0 | |
conv_btc_to_cryp2_ef = 0.0 | |
ex2_to_ex1_tf = 0.001 | |
def profit(in_amt_inr, cryp_inr, cryp_btc, cryp2_btc, cryp2_inr, ex1_to_ex2_tf, conv_btc_ef, conv_btc_to_cryp2_ef, ex2_to_ex1_tf) | |
puts in_amt_cryp = (in_amt_inr.to_f / cryp_inr.to_f) - ex1_to_ex2_tf | |
puts in_amt_btc = in_amt_cryp.to_f * cryp_btc.to_f + conv_btc_ef | |
puts in_amt_cryp2 = in_amt_btc.to_f / cryp2_btc.to_f + conv_btc_to_cryp2_ef | |
puts result = (in_amt_cryp2.to_f - ex2_to_ex1_tf) * cryp2_inr.to_f | |
puts result - in_amt_inr | |
end | |
profit(in_amt_inr, cryp_inr, cryp_btc, cryp2_btc, cryp2_inr, ex1_to_ex2_tf, conv_btc_ef, conv_btc_to_cryp2_ef, ex2_to_ex1_tf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment