
This strategy uses logarithmic functions to model price changes based on the standard deviation and mean of trading volume to calculate z-score as input parameters to the logarithmic function for predicting future prices.
This strategy combines statistical information of trading volume and price prediction using logarithmic functions.
Advantages are:
Some risks also exist in this strategy:
Risks can be reduced by:
This strategy can be further optimized by:
Combining multiple methods can further improve stability and profitability.
This strategy integrates statistical indicators of trading volume and logarithmic prediction into a unique quantitative trading methodology. With continuous optimization, it can become an efficient and stable automated trading system. By leveraging machine learning and portfolio optimization theories, we are confident to further improve its trading performance.
/*backtest
start: 2023-11-19 00:00:00
end: 2023-12-10 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Logistic", overlay=true )
volume_pos = 0.0
volume_neg = 0.0
roc = roc(close, 1)
for i = 0 to 100
if (roc > 0)
volume_pos := volume
else
volume_neg := volume
volume_net = volume_pos - volume_neg
net_std = stdev(volume_net, 100)
net_sma = sma(volume_net, 10)
z = net_sma / net_std
std = stdev(close, 20)
logistic(close, std, z) =>
m = (close + std)
a = std / close
pt = m / ( 1 + a*exp(-z))
pt
pred = logistic(close, std, z)
buy = pred > close * 1.005
sell = pred < close * 0.995
color = strategy.position_size > 0? #3BB3E4 : strategy.position_size == 0? #FF006E : #6b6b6b
barcolor(color)
if (buy == true)
strategy.entry("Long", strategy.long, comment="Open L")
if (sell == true)
strategy.close("Long", comment="Close L")