Untitled
unknown
plain_text
5 months ago
3.0 kB
4
Indexable
//@version=5 strategy("Volty Expan Close Strategy", overlay=true) length = input(5) numATRs = input (0.75) ////3Commas botId = input.string("", title="Bot ID", group="3Commas", tooltip="Input your 3Commas bot ID, located in the address bar of your bot page.") emailToken = input.string("", title="Email Token", group="3Commas", tooltip="Input your 3Commas email token, which can be found on your bot information page.") var futures = input.bool(false, title = "Enable ByBit Futures", group="3Commas", tooltip="When enabled, the alert will work for 3Commas' ByBit Futures bot.") futures_exchange = input.string(defval="ByBit Futures", title="Futures Exchange", group="3Commas", options=["ByBit Futures", "Binance Futures", "OKX Futures", "GateIO Futures"], tooltip="Every Futures Exchange requires a different symbols syntax on 3Commas. Please pick the correct futures exchange for your needs.") /////3Commas MultiPair////// getBotStartMsg() => if futures if futures_exchange == "ByBit Futures" or futures_exchange == "Binance Futures" msg = '{"message_type":"bot", "bot_id":"' + botId + '", "email_token":"' + emailToken + '", "delay_seconds":0, "pair":"' + str.tostring(syminfo.currency) + '_' + str.tostring(syminfo.basecurrency) + 'USDT"}' if futures_exchange == "OKX Futures" msg = '{"message_type":"bot", "bot_id":"' + botId + '", "email_token":"' + emailToken + '", "delay_seconds":0, "pair":"' + str.tostring(syminfo.currency) + '_' + str.tostring(syminfo.basecurrency) + 'USDT"}' if futures_exchange == "GateIO Futures" msg = '{"message_type":"bot", "bot_id":"' + botId + '", "email_token":"' + emailToken + '", "delay_seconds":0, "pair":"' + str.tostring(syminfo.currency) + '_' + str.tostring(syminfo.basecurrency) + 'USDT"}' else msg = '{"message_type":"bot", "bot_id":"' + botId + '", "email_token":"' + emailToken + '", "delay_seconds":0, "pair":"' + str.tostring(syminfo.currency) + '_' + str.tostring(syminfo.basecurrency) + '"}' getBotStopMsg() => if futures if futures_exchange == "ByBit Futures" or futures_exchange == "Binance Futures" msg = '{"action": "close_at_market_price", "message_type":"bot", "bot_id":"' + botId + '", "email_token":"' + emailToken + '", "delay_seconds":0, "pair":"' + str.tostring(syminfo.currency) + '_' + str.tostring(syminfo.basecurrency) + 'USDT"}' else msg = '{"action": "close_at_market_price", "message_type":"bot", "bot_id":"' + botId + '", "email_token":"' + emailToken + '", "delay_seconds":0, "pair":"' + str.tostring(syminfo.currency) + '_' + str.tostring(syminfo.basecurrency) + '"}' atrs = ta.sma(ta.tr,length) *numATRs if (not na(close[length])) strategy.entry("VItC1sLE",strategy.long, stop=close+atrs, comment = "VItC1sLE", alert_message = getBotStartMsg()) strategy.entry("VItClsSE", strategy.short, stop=close-atrs, comment = "VltClsSE", alert_message = getBotStopMsg()) //plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
Editor is loading...
Leave a Comment