Long short position tools
Long position calculations¶
Position size¶
Where:
QtyRisk = (RiskSize / ((EntryPrice - StopPrice) * PointValue)) / LotSize
QtyLvg = (AccountSize * Leverage / EntryPrice) * PointValue / LotSize
Account balance after take profit¶
Account balance after stop loss¶
Target level¶
TP price offset = ProfitPrice - EntryPrice
TP percent offset = ((ProfitPrice - EntryPrice) / EntryPrice) * 100
Stop level¶
SL price offset = EntryPrice - StopPrice
SL percent offset = ((EntryPrice - StopPrice) / EntryPrice) * 100
Risk/reward ratio¶
Profit PnL¶
Loss PnL¶
Open and closed PnL behavior¶
For long positions:
- If the tool is placed over historical data with no bars inside the tool area:
- If the entry price is not reached, or neither take profit nor stop loss is reached, the tool can still show open PnL based on the relevant chart state.
- If the tool is placed in the future where no bars exist yet:
- If the take-profit level is reached:
- If the stop-loss level is reached:
Short position calculations¶
Position size¶
Where:
QtyRisk = (RiskSize / ((StopPrice - EntryPrice) * PointValue)) / LotSize
QtyLvg = (AccountSize * Leverage / EntryPrice) * PointValue / LotSize
Account balance after take profit¶
Account balance after stop loss¶
Target level¶
TP price offset = EntryPrice - ProfitPrice
TP percent offset = ((EntryPrice - ProfitPrice) / EntryPrice) * 100
Stop level¶
Stop price offset = StopPrice - EntryPrice
Stop percent offset = ((StopPrice - EntryPrice) / EntryPrice) * 100
Risk/reward ratio¶
Profit PnL¶
Loss PnL¶
Open and closed PnL behavior¶
For short positions:
- If the tool is placed over historical data with no bars inside the tool area:
- If the entry price is not reached, or neither take profit nor stop loss is reached, the tool can still show open PnL based on the relevant chart state.
- If the tool is placed in the future where no bars exist yet:
- If the take-profit level is reached:
- If the stop-loss level is reached:
Shared variables¶
When risk is entered as a fixed value.