XPayBot Docs
WebsiteTelegram Bot
  • WHITEPAPER
    • XPayBot Abstract: Revolutionizing Automated Trading on Decentralized Exchanges
    • Introduction
    • XPayBot Features
    • Overview
    • Vision
    • Market Insights
    • Token
    • Referral Program
    • Signals Groups and Strategies Implementation
    • DEX MM For Teams (coming soon)
    • Educational Resources
    • Roadmap
    • FAQs
  • SUMMARY XPAYBOT
    • Fees
    • Referral Rewards
  • $XPAY TOKEN
    • All Things $XPAY
  • XPAYBOT SIGNAL GROUPS
    • The Degen
    • The Scalper
  • USER GUIDE
    • Introduction
    • Trading Strategy Creation
    • Backtesting
    • Final Strategy Adjustments
    • TradingView to Telegram process
    • XPayBot Tutorial
  • TEMPLATES
    • Pinescript Template_Testing
    • Pinescript Template_Main
    • TradingView Alert Message
    • Webhook URL
  • XPAYBOT
    • Bot
    • Dashboard
    • Website
    • X (Twitter)
    • Telegram
    • YouTube
    • Medium
  • XPAYETH
    • Website
    • X (Twitter)
    • Telegram
    • Medium
  • TOKEN
    • DexTools
    • DexScreener
    • CoinMarketCap
    • CoinGecko
    • Etherscan
  • BUY
    • Uniswap
    • Flooz Trade
    • BananaGun Bot
  • LEGAL
    • T&Cs
    • Disclaimer
    • Privacy Policy
Powered by GitBook
On this page

Was this helpful?

  1. TEMPLATES

Pinescript Template_Main

MAKE SURE TO GENERATE CODE WITH THESE ATTRIBUTES:
- Write all code below suitable for Pine Script version 5
- It must be suitable for TradingView Pine Editor
- Never use the word "crossover" or "crossunder" and replace with "ta.crossover" and "ta.crossunder" respectively

// This code is meant for after you have backtested using the testing script and ready to trade

// @version=5
strategy("insert_strategy_name_here", overlay=true)

// STRATEGIES

// Input Strategy Variables



// Buy condition:
buy_signal = (insert_buy_signal_here)

// Sell condition:
sell_signal = (insert_sell_signal_here)

// Change this value to determine the $ amount to trade with
qty_value = 1000
// DO NOT TOUCH
price = close
qty = qty_value / price

// Plot buy and sell signals on the chart
plotshape(series=buy_signal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(series=sell_signal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)

// Check if there are any open trades (DO NOT TOUCH)
open_trades = strategy.opentrades

// DO NOT TOUCH
if (buy_signal and open_trades == 0)
    strategy.entry("Buy", strategy.long, qty=qty)
if (sell_signal)
    strategy.close("Buy")
PreviousPinescript Template_TestingNextTradingView Alert Message

Last updated 10 months ago

Was this helpful?