you're answer did point me in the right direction though, I checked the pom of the module, updated the lombok dependency and that seemed to work, so thanks a bunch
Suddently, I don't know why, the autogeneration of my lombok getters and setters are failling.
Anyone knows why this might be the case? I checked if anotation processing is turned on, I reinstalled the lombok plugin, I even reinstalled my ide, nothing worked
makerfee I already figured out, that was a simple typo, why the amount is way of is a mystery to me, the taker is of because it get's multiplied by the amount
Here's an example: The expression "(a - b) * cᵈ" means that b belongs to the subtraction operation and not to the multiplication operation. It does NOT mean that you subtract b from a before you raise c to the power d.
No, but it does mean you substract b from a and raise c to the power of d before multyplying the two, if you write a - b * cᵈ, then you have a whole other result, cause according my understanding you then first raise c to the power of d, multiply it with b and substract the result from a
This is an example of the results and what I get when I use the same formula in a calculator:
Welcome to the ranch. I think you're supposed to ask a new question, not reply in a thread from several years ago, but that's easy enough.
First you calculate the middle of the String.
Then break the original string in two based on the index you calculated and assing it, in reversed order, to a StringBuilder .
Finally you have to covert the StringBuilder back to a String
edit:since cambel told me I already gave to mutch tips, I changed my answer a bit
I'm trying to calculate de profit of an arbitragetrade, but for some reasson, the program dosn't get the result I expect.
These are the variables of the formula:
moneyToSpend = 0.1 btc (which is give or take depending on the current rate 100$)
askPrice = the lowest askingprice for a coin across a list of exchanges in btc
bidPrice = the highest bidprice for a coin across a list of exchanges in btc
amount (the amount to be bought) = moneyToSpend / askPrice
takerFee (needs to be payed when buying the coin on exchange a) = takerFeePercentage (is kept in a constant for each exhange) * amount
WithdrawalFee (needs to be payed when transfering the coin from exchange a to b) = a fixed amount based on the coin and exchange kept in an enum
makerFee (needs to be payed when selling on exchange b) = makerFeePercentage(is kept in a constant for each exhange) * (amount - takerFee - withdrawalFee)
profit = (bidPrice - askPrice) * (amount- takerFee - withdrawalFee - makerFee)
In code I translated it to:
The formula seems logic to me, am I that stupid or does java not follow simple mathrules anymore, like calculate first what's between parentheses?
Couldn't mean a 401 that the authentications simply failed? There is no username and password, or there is but the username is the apikey and the password the secret, which I send in the header of the getrequest
The whole reasson is suggested using a hashmap was because I assumed he didn't use an object cause the specs defined to use a collection.
Whenever I read I'm new to java, I kinda asume it's an assignment for some type of course (what isn't always the case, I know), so in that case he can't use whatever
How set are you on using an array, if you have key/valuepairs sounds like a hashmap or something like that is more suited, it would let you serch the map for the value on the key.
If you want to use an array you will have to loop it and check every item in the earray to see if it's the one that needs to be changed
I'm trying to use basic authentication to authenticated my request, but for some reasson I keep getting a 404
this is what I'm doing.
The MethodCall:
The Method:
When opening the url in my browser, I'm being prompt with a login, as exspected, when I manually fill in the key as username and the secret as password, it logs in, so the header must be set wrong...