Vendrel
Vendrel

Reputation: 987

How to specify % of Equity and Leverage in this strategy.entry() function?

Here's an example code for the strategy. Titles, overlay removed for better readability.

strategy(initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value = 100)

strategy.entry("Short", strategy.short, when = short_entry)

How to include Percent of Equity and Leverage into it?

For example:

Upvotes: 0

Views: 664

Answers (1)

Andrey D
Andrey D

Reputation: 1714

Like this

//@version=5
strategy("My strategy", initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value = 5, margin_long=10, margin_short=10)

Upvotes: 1

Related Questions