pine script - Is there a way to incorporate dynamic commission fees in the TradingView Strategy Tester? - Stack Overflow
I am trying to incorporate a dynamic commission fee in the strategy tester. I am aware the PineScript strategy
function provides some functionality to specify commission fees, for example
strategy(..., commission_type=strategymission.cash_per_contract, commission_value=0.005)
This however is a bit restrictive in terms of setting a min commission fee.
The outcome I am looking for is being able to set a min commission value, for example:
- Flat fee per share: $0.005
- Minimum fee per trade: $1.00
If flat fee * quantity is less than $1, use $1.
I have tried calculating the fee and setting it after strategy initialization, this however does not work since it does not seem the strategy instance provides an attribute for such a case:
if (strategy.position_size < 0) // Short position
....
....
....
if (....)
// Perhaps set fee here in some way
strategy.close("Short")
Is the outcome I am trying to achieve possible in the trading view strategy tester?
最新文章
- 苹果宣布软件免费 将引发PC革命(组图)
- AMD、英特尔等开始疏远Windows
- 传统杀毒软件市场受冲击 McAfee计划裁员7100人
- Google的AR眼镜
- 后PC时代是五足鼎立还是苹果独领风骚?
- python - Why does Ridge Regression behave like this when visually tracking an object? - Stack Overflow
- Azure web app High availability with DNS failover - Stack Overflow
- audio - How can i improve my sound module in Java? - Stack Overflow
- typescript - tag a href download filename nextjs - Stack Overflow
- caching - Pytorch: the cache is constantly increasing - Stack Overflow
- performance testing - How to retrieve the dynamic value from the JMeter - Stack Overflow
- c - Dereferencing a valid pointer results in an error - Stack Overflow
- Flutter - individual bloc states - Stack Overflow
- wordpress - Give access to users own submitted entries only wpforms - Stack Overflow
- angular - Infer types in callback chain based on `null` return as success Indicator - Stack Overflow
- Stripe Connect, Register fake account on test mode - Stack Overflow
- python - Airflow on_success_callback - Stack Overflow