CrossTrade Docs
CrossTrade.io
  • Welcome!
    • Set Up Guide
  • Getting Started
    • Installation
    • User Dashboard
      • XT Control Panel
      • Command Tester
      • Command Builder
    • Alert History
    • TradingView Alerts
      • Dynamic Variables
      • XT Alert Builder
      • Example Indicators
      • Example Strategies
    • VPS Connection Guide
  • Webhooks
    • Overview
    • Commands
      • Place Order
      • Flat Place Order
      • Close Position
      • Reverse
      • Reverse Position
      • Flatten Positions
      • Flatten Everything
      • Cancel Order
      • Cancel Orders
      • Cancel All Orders
      • Cancel Replace
      • Change Order
      • Close Strategy
    • Advanced Options
      • Multi-Account Placement
      • Flatten First
      • Require Market Position
      • Max Positions
      • Bracket Orders
      • Percentage and Tick Prices
      • Limit Order Timeouts
      • Trading Window
      • Bypass Trade Windows
      • Delay Timer
      • Rate-Limiting
      • Alert Commenting
      • Kill Switch
      • Notes
    • Examples & Use Cases
    • Troubleshooting
  • Account Manager
    • Overview
      • How It Works
      • Dashboard
      • Global Settings
      • Frequently Asked Questions (FAQ)
    • Monitors
      • Profit/Loss Thresholds
      • Minimum Profit Drawdown
      • Trailing Drawdown
      • Advanced Usage
    • Account Settings
      • Auto-Flattening
      • Trading Windows
    • Management Logs
  • NinjaTrader
    • ATM Strategies
      • Creating ATM Template
    • Optimizing NinjaTrader Performance
    • Enabling Multi-Provider Mode
  • CrossTrade API
    • Overview
    • Authentication
    • Rate Limiting
    • Webhook Trading
    • Accounts
      • GET Accounts Summary
      • GET Accounts
      • GET Account
    • Positions
      • GET Positions
      • GET Position
      • POST Close Position
      • POST Reverse
      • POST Reverse Position
      • POST Flatten Positions
      • POST Flatten Everything
    • Orders
      • GET Orders
      • GET Order
      • GET Order Status
      • POST Cancel Order
      • POST Cancel Orders
      • POST Cancel All Orders
      • POST Place Order
      • POST Flat Place Order
      • POST Replace Order
      • PUT Change Order
    • Strategies
      • GET Strategies
      • GET Strategy
      • POST Close Strategy
    • Executions
      • GET Executions
      • GET Execution
    • Quotes
      • GET Quote
  • Changelog
    • XT Versions
    • All Updates
  • Affiliate Program
    • Media Kit
  • Social Links
    • Discord
    • TradingView
    • YouTube
    • X (Twitter)
    • Instagram
    • Facebook
    • Reddit
    • Website
    • Blog
Powered by GitBook
On this page
  • SMA Crossover Strategy
  • SMA Crossover Strategy with 50 Tick TP/SL
  1. Getting Started
  2. TradingView Alerts

Example Strategies

TradingView example Strategies that highlight different ways to use Alerts with CrossTrade

PreviousExample IndicatorsNextVPS Connection Guide

Last updated 1 month ago

SMA Crossover Strategy

Strategies can not be programmed to automatically supply a payload into the message field, so you will need to manually copy and paste. Strategies offer the use of dynamic variables to tell crosstrade certain information about the command. We can use the strategy order action and quantity in place of BUY or SELL in the action field, and supplying a numerical value for the quantity.

key=Your CrossTrade Secret Key; command=PLACE; account=sim101; instrument=ES 06-25; action={{strategy.order.action}}; qty={{strategy.order.quantity}}; order_type=MARKET; tif=DAY; flatten_first=true; Additionally, you can provide take_profit and stop_loss levels with your strategy alert. They can be supplied as either numerical values, tick, or percentage based. Examples:

take_profit=5%;
stop_loss=-25 ticks;
limit_price=-2.5%;
stop_price=12 ticks;

SMA Crossover Strategy with 50 Tick TP/SL

Building off of the previous two examples, this strategy includes the entire message payload inside the Pine Script which allows you the ability to provide the stop and target levels dynamically. Additionally, because the message payload is inside of the strategy, all that is required inside of the TradingView Alert Message is the dynamic variable for {{strategy.order.alert_message}}

Don't forget to add your secret key inside the strategy code

We are including to close any existing position before opening a new one.

flatten_first
LogoXT Example Strategy by CrossTradeTeam — TradingViewTradingView
SMA Crossover Strategy
SMA Crossover strategy with stop and targets
LogoSMA Crossover with 50 Tick SL/TP — Strategy by CrossTradeTeam — TradingViewTradingView