all compiling

This commit is contained in:
Dobromir Popov 2024-01-12 17:39:10 +02:00
parent 5afee8e343
commit 39e2dba692
3 changed files with 46 additions and 2 deletions

View File

@ -1,6 +1,42 @@
//@version=5
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]
rsiLength = input(14, title="RSI Length")
stochRsiLength = input(14, title="Stochastic RSI Length")

View File

@ -52,19 +52,22 @@ calcPoints(symbol) =>
shortPoints := obv < obv[1] ? shortPoints + 1 : shortPoints
longPoints := mfiValue > 50 ? longPoints + 1 : longPoints
shortPoints := mfiValue < 50 ? shortPoints + 1 : shortPoints
var logMessage = "Symbol: " + symbol + ", Long: " + str.tostring(longPoints) + ", Short: " + str.tostring(shortPoints)
log.info(logMessage)
[longPoints, shortPoints]
// Symbols array
symbols = array.new_string(5)
array.set(symbols, 0, "US30")
array.set(symbols, 0, syminfo.tickerid)
array.set(symbols, 1, "GOLD")
array.set(symbols, 2, "DXY")
array.set(symbols, 3, "BTCUSDT.P")
array.set(symbols, 4, syminfo.tickerid)
array.set(symbols, 4, "US30" )
// Calculate points for each symbol
var symbolPoints = array.new_int(2, 0)
for symbol in symbols
// Change symbol context using security() function
[longPoints, shortPoints] = calcPoints(symbol)
var logMessage = "Symbol: " + symbol + ", Long: " + str.tostring(longPoints) + ", Short: " + str.tostring(shortPoints)
log.info(logMessage)

View File

@ -34,6 +34,11 @@ obv := close > close[1] ? obv + volume : close < close[1] ? obv - volume : obv
mfiLength = input(7, title="MFI Length")
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
longPointsRSIBTC = close > close[1] ? 1 : 0
shortPointsRSIBTC = close < close[1] ? 1 : 0