all compiling
This commit is contained in:
parent
5afee8e343
commit
39e2dba692
@ -1,6 +1,42 @@
|
|||||||
//@version=5
|
//@version=5
|
||||||
indicator("DrNiki's Market Nuker", shorttitle="DrNiki's Market Nuker", overlay=true)
|
indicator("DrNiki's Market Nuker", shorttitle="DrNiki's Market Nuker", overlay=true)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// /*
|
||||||
|
// create a calculator in pinescript that uses all of this data at the same time:
|
||||||
|
// here are the pairs:
|
||||||
|
// -US30
|
||||||
|
// -GOLD
|
||||||
|
// -DXY (for this pair inverse the results, each long point goes to a short point and vice versa)
|
||||||
|
// -BTCUSDT.P
|
||||||
|
// -syminfo.ticker
|
||||||
|
// (e.g.:pairs = ["US30", "GOLD", "DXY", "BTCUSDT.P", syminfo.ticker])
|
||||||
|
|
||||||
|
// use these 4 timeframes:
|
||||||
|
// 1 hour
|
||||||
|
// 2 hour
|
||||||
|
// 3 hour
|
||||||
|
// 4 hour
|
||||||
|
|
||||||
|
// Use these 4 indicators:
|
||||||
|
|
||||||
|
// Wavetrend with crosses [LazyBear] and use wt1 only - when it goes higher than the previous candle from the timeframe specified (we specified 4 timeframes) give it 1 point for longs. When it goes lower than the previous candle from the current timeframe specified (we specified 4 timeframes) give it 1 point for shorts
|
||||||
|
|
||||||
|
// for rsi do the same
|
||||||
|
|
||||||
|
// for stoch rsi K line do the same
|
||||||
|
|
||||||
|
// for OBV do the same
|
||||||
|
|
||||||
|
// DO it on all pairs and on all timeframes at the same time, the maximum odds should be 100% total. write the results in a text with the odds per pair for a long and short based on each timeframe and pair and based on each pair and timeframe.
|
||||||
|
// Then have a total when you have the most efficient way of combining them calculated
|
||||||
|
|
||||||
|
|
||||||
|
// */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// [Input for Indicators]
|
// [Input for Indicators]
|
||||||
rsiLength = input(14, title="RSI Length")
|
rsiLength = input(14, title="RSI Length")
|
||||||
stochRsiLength = input(14, title="Stochastic RSI Length")
|
stochRsiLength = input(14, title="Stochastic RSI Length")
|
||||||
|
@ -52,19 +52,22 @@ calcPoints(symbol) =>
|
|||||||
shortPoints := obv < obv[1] ? shortPoints + 1 : shortPoints
|
shortPoints := obv < obv[1] ? shortPoints + 1 : shortPoints
|
||||||
longPoints := mfiValue > 50 ? longPoints + 1 : longPoints
|
longPoints := mfiValue > 50 ? longPoints + 1 : longPoints
|
||||||
shortPoints := mfiValue < 50 ? shortPoints + 1 : shortPoints
|
shortPoints := mfiValue < 50 ? shortPoints + 1 : shortPoints
|
||||||
|
var logMessage = "Symbol: " + symbol + ", Long: " + str.tostring(longPoints) + ", Short: " + str.tostring(shortPoints)
|
||||||
|
log.info(logMessage)
|
||||||
[longPoints, shortPoints]
|
[longPoints, shortPoints]
|
||||||
|
|
||||||
// Symbols array
|
// Symbols array
|
||||||
symbols = array.new_string(5)
|
symbols = array.new_string(5)
|
||||||
array.set(symbols, 0, "US30")
|
array.set(symbols, 0, syminfo.tickerid)
|
||||||
array.set(symbols, 1, "GOLD")
|
array.set(symbols, 1, "GOLD")
|
||||||
array.set(symbols, 2, "DXY")
|
array.set(symbols, 2, "DXY")
|
||||||
array.set(symbols, 3, "BTCUSDT.P")
|
array.set(symbols, 3, "BTCUSDT.P")
|
||||||
array.set(symbols, 4, syminfo.tickerid)
|
array.set(symbols, 4, "US30" )
|
||||||
|
|
||||||
// Calculate points for each symbol
|
// Calculate points for each symbol
|
||||||
var symbolPoints = array.new_int(2, 0)
|
var symbolPoints = array.new_int(2, 0)
|
||||||
for symbol in symbols
|
for symbol in symbols
|
||||||
|
// Change symbol context using security() function
|
||||||
[longPoints, shortPoints] = calcPoints(symbol)
|
[longPoints, shortPoints] = calcPoints(symbol)
|
||||||
var logMessage = "Symbol: " + symbol + ", Long: " + str.tostring(longPoints) + ", Short: " + str.tostring(shortPoints)
|
var logMessage = "Symbol: " + symbol + ", Long: " + str.tostring(longPoints) + ", Short: " + str.tostring(shortPoints)
|
||||||
log.info(logMessage)
|
log.info(logMessage)
|
||||||
|
@ -34,6 +34,11 @@ obv := close > close[1] ? obv + volume : close < close[1] ? obv - volume : obv
|
|||||||
mfiLength = input(7, title="MFI Length")
|
mfiLength = input(7, title="MFI Length")
|
||||||
mfiValue = ta.mfi(close, mfiLength)
|
mfiValue = ta.mfi(close, mfiLength)
|
||||||
|
|
||||||
|
|
||||||
|
timeStr = str.tostring(time(timeframe.period, "YYYY-MM-DD HH:mm:ss"))
|
||||||
|
closeStr = str.tostring(close)
|
||||||
|
log.info("time: " + timeStr + " close: " + closeStr)
|
||||||
|
|
||||||
// Initialize points for BTCUSDT.P
|
// Initialize points for BTCUSDT.P
|
||||||
longPointsRSIBTC = close > close[1] ? 1 : 0
|
longPointsRSIBTC = close > close[1] ? 1 : 0
|
||||||
shortPointsRSIBTC = close < close[1] ? 1 : 0
|
shortPointsRSIBTC = close < close[1] ? 1 : 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user