Setting up Tradingview.com

1. Go to website www.tradingview.com and login.
2. Create your own profitable strategy or load someone elses strategy (Our example strategy.)
3. Turn that strategy to study! (or copy-paste example study from below)
4. Now that you have study in your chart, you can create alerts.
5. Leave the chart running with alerts and go start Traderelay software.

Example study with alerts

Its written with Pinescript v.4. Just copy-paste it to Tradingview.com


//STUDY CODE START
//@version=4
study("EMA study with alerts", shorttitle = "EMA study with alerts", overlay=true)

//EMAS
Length1 = input(14, minval=1)
Length2 = input(26, minval=1)

xEMA1 = ema(close, Length1)
xEMA2 = ema(close, Length2)

plot(xEMA1, color=color.fuchsia,linewidth=3, title="EMA 14")
plot(xEMA2, color=color.yellow, linewidth=3, title="EMA 26")

enterL = 0
if (xEMA1 > xEMA2) 
    enterL := 1
    
enterS = 0    
if (xEMA1 < xEMA2) 
    enterS := 1
    
exitL = 0
if (xEMA1 < xEMA2) 
    exitL := 1
    
exitS = 0    
if (xEMA1 > xEMA2) 
    exitS := 1

//CHECK CURRENT POSITION
bool inLongPosition  = na
inLongPosition := enterL[1] ? true : exitL[1] ? false : inLongPosition[1]
bool inShortPosition = na
inShortPosition:= enterS[1] ? true : exitS[1] ? false : inShortPosition[1]

//ENTER
alertcondition(enterL and not inLongPosition, title="enterL", message="enterL")   //alert
plotshape(enterL and not inLongPosition, style=shape.triangleup, color=color.green, location=location.abovebar)
plotshape(enterL and not inLongPosition, style=shape.labelup, text="enterL", color=color.yellow, location=location.abovebar, transp=70)

alertcondition(enterS and not inShortPosition, title="enterS", message="enterS")  //alert
plotshape(enterS and not inShortPosition, style=shape.triangledown, color=color.red, location=location.belowbar)
plotshape(enterS and not inShortPosition, style=shape.labeldown, text="enterS", color=color.yellow, location=location.belowbar, transp=70)

//EXIT 
alertcondition(exitL and inLongPosition, title="exitL", message="exitL")  //alert
plotshape(exitL and inLongPosition, style=shape.xcross, color=color.green, location=location.abovebar)
plotshape(exitL and inLongPosition, style=shape.labeldown, text="exitL", color=color.red, location=location.belowbar, transp=70)

alertcondition(exitS and inShortPosition, title="exitS", message="exitS")  //alert
plotshape(exitS and inShortPosition, style=shape.xcross, color=color.red, location=location.belowbar)
plotshape(exitS and inShortPosition, style=shape.labelup, text="exitS", color=color.red, location=location.abovebar, transp=70)

//STUDY CODE ENDS



Creating alert in tradingview.com

Traderelay software needs certain kind of alert message from your Tradingview strategy. Following picture demonstrates what you should fill in to your alert window. Example shows how to set alert to trade AMD on Interactive Brokers.

Create alert


Setting up TradeRelay software

-Set your computers time to EST/Eastern Time
This is a must because Traderelay checks that old alerts(over 5min) are not relayed to Exchanges.

-Install TradeRelay software on your computer

-Login with your email and password
-Go to Settings tab and fill in:

  • Fill in api keys for Binance, Kraken, IB, which ever exchange you want to use.
  • IB: should work on default setting if you just have IB TWS running on same computer
  • IB: Port is 7497 for IB TWS (default) and 4001 if you want to use IB Gateway

-Save settings

SETUP new instrument to trade

-Add new symbol or its Conid which you want to trade (for example AMD or its Conid: 4391)
-Select Sectype for new symbol:

  • Binance - for all that go to Binance exchange
  • Kraken - for all that go to Kraken exchange
  • IBSTK - for stock orders to interactive brokers
  • IBCASH - for forex orders to interactive brokers
  • IBCFD - for CFD orders to interactive brokers
  • IBFUT - for Futures orders to interactive brokers
-If symbol or conid is for Futures, you have to select exchange for it:

  • Globex (default if nothing is chosen)
  • ECBOT
  • CFE
  • NYBOT
  • NYMEX
  • IBFUT

-Press run+ so new symbol is green on the list, and tradeable!

START TRADING

-Press START and TradeRelay begins to check received alerts and relaying orders.

-PLEASE TEST IT FIRST WITH PAPERTRADING OR SMALL MONEY!!



Interactive Brokers

If you use Interactive brokers to trade Stocks, CFDs or Forex.

-You have to install & run IB TWS (or IB Gateway) on your computer. It is an application that handles your orders. And its handy to see your portfolio etc.
Download IB TWS here