Connect Trading Signals To PSStrategyX

Here's an example of connecting a Signal Generator to the PSStrategyX tool.

Add another script to your chart by opening a new script in the pine editor and copying and pasting the code below, saving, and clicking "Add to chart".

//@version=5
indicator(title="MA Cross Example", overlay=true, timeframe="", timeframe_gaps=true)
shortlen = input.int(9, "Short MA Length", minval=1)
longlen = input.int(21, "Long MA Length", minval=1)
short = ta.sma(close, shortlen)
long = ta.sma(close, longlen)
plot(short, color = #FF6D00, display = display.pane)
plot(long, color = #43A047, display = display.pane)
buy = ta.crossover(short, long)
sell = ta.crossunder(short, long)
signal = buy ? 1 : sell ? -1 : na
plotshape(buy, '', shape.labelup, location.belowbar, color.green, 0, 'BUY', color.black, display = display.pane)
plotshape(sell, '', shape.labeldown, location.abovebar, color.red, 0, 'SELL', color.black, display = display.pane)
plot(signal, 'Signal', display = display.data_window)
  1. In the settings of the PSStrategyX, select the output of the other script as the source in the "source" dropdown.

Now you are ready to use the tool to analyze the chart and make trading decisions. The script will automatically update with the latest data as you move the chart, so you can see how your analysis changes over time.

Where to go next?

If you want to set up the Broker Connecter to start live trading, head to the next section --> Set Up Autoview

If you're not ready to live trade because you want to do some backtesting you can head to want to "Tips And Tricks" and start tweaking your strategy until you are ready to test it live.

Last updated