You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The stoploss and take profit levels are triggered successfully. Everything works as expected except the return value.
The PnL is calculated based on the return percentage multiplied by the order amount, but I want the total order amount deducted. Not just a percentage of it. Basically, if stop loss is hit, take $20, else calculate based on the risk=$20 multiplied by the tp_stop value. Usually to get such value, I'd have to dramatically increase the size of the order but I do not think manipulating the size is the best approach.
Please let me know what I'm missing or a resource to look at for this use case. Thanks for this awesome library!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@polakowo
Hi, I have a specific issue related to order amount and PnL value.
Currently, this is how i define my portfolio
init_cash=$1000
size=$20 on each order
The stoploss and take profit levels are triggered successfully. Everything works as expected except the return value.
The PnL is calculated based on the return percentage multiplied by the order amount, but I want the total order amount deducted. Not just a percentage of it. Basically, if stop loss is hit, take $20, else calculate based on the risk=$20 multiplied by the tp_stop value. Usually to get such value, I'd have to dramatically increase the size of the order but I do not think manipulating the size is the best approach.
Please let me know what I'm missing or a resource to look at for this use case. Thanks for this awesome library!
Beta Was this translation helpful? Give feedback.
All reactions