How to use Leverage in PineScriptI believe there are many friends who have been confused by the leverage problem of TradingView strategy, when backtesting, it is always unable to bring its own leverage, so it is impossible to do leverage sustained compounding, this key point, and many friends are looking forward to solve. In particular, the default_qty_value = 100, where 100 is the upper limit.
Here I have used the official RSI strategy for demonstration, using the qty to place orders. Through strategy.equity, leverage and close price, and rounding, directly calculate the specific number of contracts need to be opened.
I hope you can enjoy solving the leverage problem, and I look forward to your pointing out my problems and shortcomings to me. Thank you.
Leveragetrading
BTC BOT [15min]This BOT is specialy designed for BTCUSDT 15 min Chart. It reacts to every Upward/Downward direction as fast as possible. It does not work well on higher time frame.
This BOT using 10 indicators to open a basic LONG/SHORT position.
1. CLOUD
2. TREND DETECTOR
3. TREND STRENGTH
4. PARABOLIC SAR
5. JMA
6. RANGE FILTER
7. ADX
8. TWAP TREND
9. FAST MA
10. MOMENTUM
This BOT also use 02 independent strategies for entering positions.
1. REVESALS (RSI Crossovers)
2. SCALPING (It can increase net profit but it can be risky)
ADX is the main component of this BOT.
This is purely BTC 15min strategy but this BOT could be easily convert into Altcoins Scalper.
MACD 50x Leveraged Strategy Real Equity Simulation Hello, I wrote this script to merge the two scripts I shared before.
The aim here is to see the real value of the state of the capital as a result of leveraged transactions and to combine both long and short directions.
Scripts :
MACD Long 50x Leverage Strategy :
MACD Short 50x Leverage Strategy :
The parameters have not changed so they are the same as the previous two scripts:
Adding margin: Forbidden or not specified. (Add Margin : No)
Position Size : %1 (0.01) (For each trade)
Stop-Loss : %2 (For each trade)
Long : Crossover(delta,0) (Standard MACD)
Long Exit : Long Stop Level or Short Entry
(In the case of Long Stop, all trades are closed and no positions are opened in short direction.)
Short : Crossunder(delta,0) (Standard MACD)
Short Exit : Short Stop or Long Entry
(In the case of Short Stop, all trades are closed and no positions are opened in the long direction.)
NOTE :
This is a simulation made using standard parameters, showing the state of the balance in very simple rules with leveraged transactions only.
The nice thing here is the direct observation of the results by making modifications on the strategy parameters.
Regards.
MACD 50x Leveraged Long Strategy Results with Real Equity Hello there.
I was looking for a way to simulate leveraged transactions in Tradingview and this script came out.
You can examine the equity graph without looking at the strategy results.
Thus, the facts will come to light.
Strategy parameters:
Adding margin: Forbidden or not specified. (Add Margin : No)
Position size: (for each trade) 1%
Stop-Loss: (2%)
Long: macd crossover
Exit: macd crossunder
Or ofc touching the stop-Loss value as predicted.
Warning: This strategy simulation is for Long direction only.
Regards.