When utilizing a coded strategy, is it feasible to make deposits into the account? Would using Backtester.CurrentEquity work for this purpose? I am seeking a way to simulate leverage effectively. If I am operating at a leverage of 1:100, then each profit from a trade should add the value multiplied by 100 to the balance. Conversely, each loss should decrease the balance by the same amount without multiplying.
If it's not possible, it appears that a viable alternative would be to start with a significantly large initial capital. Then, maintain a customized Account class that operates behind the scenes. This class would be utilized for sizing trades and tracking account values for logging purposes at the end.
If it's not possible, it appears that a viable alternative would be to start with a significantly large initial capital. Then, maintain a customized Account class that operates behind the scenes. This class would be utilized for sizing trades and tracking account values for logging purposes at the end.
Rename
QUOTE:
When utilizing a coded strategy, is it feasible to make deposits into the account?
Vote for this feature request:
Periodical refill of capital
QUOTE:
If I am operating at a leverage of 1:100, then each profit from a trade should add the value multiplied by 100 to the balance.
What about setting the Margin Factor to 100:1?
Turn on Futures Mode in the Backtest Preferences (F12).
Depending on the asset, you may have to assign the contract specifications to apply the correct amount of leverage.
Even if the instrument isn't really a "futures contract" you can still do it. For example, you can create a record for QQQ in the Market & Symbols tool and assign 100 for the Point Value. With Futures Mode enabled, you'll get a 100x return for trades in QQQ.
Depending on the asset, you may have to assign the contract specifications to apply the correct amount of leverage.
Even if the instrument isn't really a "futures contract" you can still do it. For example, you can create a record for QQQ in the Market & Symbols tool and assign 100 for the Point Value. With Futures Mode enabled, you'll get a 100x return for trades in QQQ.
Your Response
Post
Edit Post
Login is required