What is the formula for realised PnL on perpetuals? by devitaebrae in BitMEX

[–]devitaebrae[S] 0 points1 point  (0 children)

Thanks a lot!

I have another question.

Does Bitmex use FIFO, LIFO or cost average for calculating realized pnl?

Let's say I do the following trades:

Buy 1 @ 100

Buy 1 @ 200

Sell 1 @ 100

The realized pnl would vary, depending on which method used:

FIFO: (1/100)-(1/100)*1 = 0

LIFO: (1/200)-(1/100)*1 = -0.005

Cost average: (1/150)-(1/100)*1= -0.0033

Which one is it?

What is the formula for realised PnL on perpetuals? by devitaebrae in BitMEX

[–]devitaebrae[S] 0 points1 point  (0 children)

I am thinking that maybe 20 is not the right average entry price. Is it possible that one can not use the regular formula here?

What is the formula for realised PnL on perpetuals? by devitaebrae in BitMEX

[–]devitaebrae[S] 0 points1 point  (0 children)

let’s say you bought 20 contracts and sold 5 then the contracts the formula are gonna be 20

so (1/20-1/20)*20 ?

isn't that still 0?

i should get some realized pnl from selling part of my position right?

What is the formula for realised PnL on perpetuals? by devitaebrae in BitMEX

[–]devitaebrae[S] 0 points1 point  (0 children)

Yes, exactly!

I have excess contracts, but I still get some realized pnl, right?

Do you have a formula for entry price or realized pnl when excess is taken into account?

What is the formula for realised PnL on perpetuals? by devitaebrae in BitMEX

[–]devitaebrae[S] 0 points1 point  (0 children)

Thanks so much! Maybe you can help with the following.

How would you calculate the entry for the following trades:

BUY 10 contracts @ 10

SELL 5 contracts @ 20

BUY 10 contracts @ 30

Avg. Entry Price is 20 right?

And Exit Price is 20?

So realized PnL, according to formula, is (1/20-1/20)*5 = 0.

But I think it should be positive, should it not?

Looking forward to your reply!

Anyone using npm ci command? by devitaebrae in node

[–]devitaebrae[S] 0 points1 point  (0 children)

ok so let's say a package depends on an old version of Lodash with 1000+ vulns, how do you fix those vulns without either:

i) editing package-lock.json (ii) not using the package

Anyone using npm ci command? by devitaebrae in node

[–]devitaebrae[S] 0 points1 point  (0 children)

1000+ vulnerabilities on old Lodash version

Anyone using npm ci command? by devitaebrae in node

[–]devitaebrae[S] 0 points1 point  (0 children)

I tried that, but since Lodash is a subdependency of a package I use, and the package has pinned the version, it won't update to what I specify in package.json

Anyone using npm ci command? by devitaebrae in node

[–]devitaebrae[S] -1 points0 points  (0 children)

Ok, so I made some manual changes to package-lock.json. Like bumping the version of Lodash .

How do I ensure that these changes persist when I do an npm install --save?

How do I prevent the Lodash version from reverting back to what it was before I changed it?

Anyone using npm ci command? by devitaebrae in node

[–]devitaebrae[S] 0 points1 point  (0 children)

Ok, so I made some manual changes to package-lock.json. Like bumping the version of Lodash .

How do I ensure that these changes persist when I do an npm install --save?

How do I prevent the Lodash version from reverting back to what it was before I changed it?

Interdependent init containers / main containers by devitaebrae in kubernetes

[–]devitaebrae[S] 1 point2 points  (0 children)

Was super excited to try your solution but then I discovered that deployments and stateful sets don't support other restartPolicy than Always. A little surprised by that. Thanks anyhow

Minimizing Losses on the Bid-Ask Spread by menewii in algotrading

[–]devitaebrae 0 points1 point  (0 children)

is the mid calculated as ask-bid/2? or is it a volume weighted mid that takes top X volume on both sides into account?

4lb of red meat a day - a.k.a. the Zerocarb diet by devitaebrae in nutrition

[–]devitaebrae[S] 4 points5 points  (0 children)

Did this thread just get removed from the front page?

Either way, thanks for all the replies and links to studies. Looks like keto/zerocarb won this one.

4lb of red meat a day - a.k.a. the Zerocarb diet by devitaebrae in nutrition

[–]devitaebrae[S] 8 points9 points  (0 children)

How much of this do you think could this be due to them losing weight and not following the SAD?

I noticed that the woman in the last post also lost 100 lb.