Spaces:
Running
65666768697071727374757677787980
Browse files// Strategy Execution with Auto-Trading
if time > timestamp(2020, 1, 1, 0, 0)
if autoTradeLong and (not inputUseNewsFilter or not isNewsTime)
strategy.entry("Long", strategy.long, qty=positionSize, when=barstate.isconfirmed)
strategy.exit("Long Exit", "Long", stop=longTrailPrice, limit=takeProfitLong)
if autoTradeShort and (not inputUseNewsFilter or not isNewsTime)
strategy.entry("Short", strategy.short, qty=positionSize, when=barstate.isconfirmed)
strategy.exit("Short Exit", "Short", stop=shortTrailPrice, limit=takeProfitShort)
The "strategy.entry" function does not have an argument with the name "when"
5:36:59 AM "Untitled script" opened
5:38:38 AM Compiling...
5:38:39 AM Error at 47:60 Could not find function or function reference 'security'
5:40:18 AM Compiling...
5:40:20 AM Compiled.
5:40:20 AM Updated on chart.
5:48:44 AM Compiling...
5:48:45 AM Error at 65:65 The "strategy.entry" function does not have an argument with the name "when"
5:48:45 AM Error at 69:67 The "strategy.entry" function does not have an argument with the name "when"
- ssl-hybrid-bot.pine +5 -5
|
@@ -19,7 +19,7 @@ sslUp = ta.ema(hmaFast > hmaSlow ? hmaFast : hmaSlow, inputSmoothing)
|
|
| 19 |
sslDown = ta.ema(hmaFast < hmaSlow ? hmaFast : hmaSlow, inputSmoothing)
|
| 20 |
|
| 21 |
// Multi-Timeframe Hull Trend Confirmation
|
| 22 |
-
hullTrend = request.security(syminfo.tickerid, "15", ta.hma(close, inputPeriod * 2))
|
| 23 |
trendDirection = ta.crossover(hullTrend, hullTrend[2]) ? 1 : ta.crossunder(hullTrend, hullTrend[2]) ? -1 : 0
|
| 24 |
|
| 25 |
// Candlestick Pattern Confirmation
|
|
@@ -61,12 +61,12 @@ isNewsTime = dayofweek == dayofweek.friday and hour >= 13 and hour <= 15
|
|
| 61 |
|
| 62 |
// Strategy Execution with Auto-Trading
|
| 63 |
if time > timestamp(2020, 1, 1, 0, 0)
|
| 64 |
-
if autoTradeLong and (not inputUseNewsFilter or not isNewsTime)
|
| 65 |
-
strategy.entry("Long", strategy.long, qty=positionSize
|
| 66 |
strategy.exit("Long Exit", "Long", stop=longTrailPrice, limit=takeProfitLong)
|
| 67 |
|
| 68 |
-
if autoTradeShort and (not inputUseNewsFilter or not isNewsTime)
|
| 69 |
-
strategy.entry("Short", strategy.short, qty=positionSize
|
| 70 |
strategy.exit("Short Exit", "Short", stop=shortTrailPrice, limit=takeProfitShort)
|
| 71 |
// Enhanced Plotting with Candlestick Alignment
|
| 72 |
plot(sslUp, color=color.new(#00E396, 0), linewidth=2, title="SSL Up")
|
|
|
|
| 19 |
sslDown = ta.ema(hmaFast < hmaSlow ? hmaFast : hmaSlow, inputSmoothing)
|
| 20 |
|
| 21 |
// Multi-Timeframe Hull Trend Confirmation
|
| 22 |
+
hullTrend = request.security(syminfo.tickerid, "15", ta.hma(close, inputPeriod * 2), lookahead=barmerge.lookahead_on)
|
| 23 |
trendDirection = ta.crossover(hullTrend, hullTrend[2]) ? 1 : ta.crossunder(hullTrend, hullTrend[2]) ? -1 : 0
|
| 24 |
|
| 25 |
// Candlestick Pattern Confirmation
|
|
|
|
| 61 |
|
| 62 |
// Strategy Execution with Auto-Trading
|
| 63 |
if time > timestamp(2020, 1, 1, 0, 0)
|
| 64 |
+
if autoTradeLong and (not inputUseNewsFilter or not isNewsTime) and barstate.isconfirmed
|
| 65 |
+
strategy.entry("Long", strategy.long, qty=positionSize)
|
| 66 |
strategy.exit("Long Exit", "Long", stop=longTrailPrice, limit=takeProfitLong)
|
| 67 |
|
| 68 |
+
if autoTradeShort and (not inputUseNewsFilter or not isNewsTime) and barstate.isconfirmed
|
| 69 |
+
strategy.entry("Short", strategy.short, qty=positionSize)
|
| 70 |
strategy.exit("Short Exit", "Short", stop=shortTrailPrice, limit=takeProfitShort)
|
| 71 |
// Enhanced Plotting with Candlestick Alignment
|
| 72 |
plot(sslUp, color=color.new(#00E396, 0), linewidth=2, title="SSL Up")
|