Select Page

APIBridgeTradingView

Strategy Premise

A Stochastic oscillator is a momentum indicator that compares a particular closing price of a security to a range of its prices over a certain period of time. The sensitivity of Stochastic to market movements is reducible by adjusting that time period or by taking a moving average of the result. Stochastic is used to generate overbought and oversold trading signals which consist of two lines:

  • one reflecting the actual value of the oscillator for each session.
  • And other reflecting its three-day simple moving average.
Stochastic Oscillator Algo Strategy

Strategy Logic

Long Entry: When Stochastic Oscillator Cross over Simple Moving Average, Send LE.

Long Exit: Either when SL or Target is hit. If SL/TGT is not hit and Stochastic Oscillator Cross Under Simple Moving Average, send LX and SE.

Short Entry: When Stochastic Oscillator Cross Under Simple Moving Average, Send SE.

Short Exit: Either when SL or Target is hit. If SL/TGT is not hit and Stochastic Oscillator Cross over Simple Moving Average, SX and LE.

Stochastic Oscillator  Strategy Parameters for TradingView Charts

Quantity: This is used to specify the trade quantity 

Custom Stop Loss in Points: Movement in chart price against the momentum which will trigger exit

Custom Target in Points: Movement in chart price against the momentum which will trigger exit

Intraday Trade Session : Entry Trade Will be Taken only on this session.

EXIT  Session : Trades will be squared off in this timeframe

Stochastic Length :The default setting for the Stochastic Oscillator is 14     periods, which can be days, weeks, months or an intraday timeframe

Upper Trigger Line: The stochastic oscillator is range-bound, meaning it is always between 0 and 100. readings over 80 are considered in the overbought range

Lower Trigger Line: The stochastic oscillator is range-bound, meaning it is always between 0 and 100. readings over 80 are considered in the overbought range readings under 20 are considered oversold.

 

TradingView Settings

To deploy this Algo Strategy on the chart, please follow the steps given below:

1: Download The Pine Script Algo  here

2: Open desired Chart in trading View with normal Candlestick, Select the desired timeframe of the chart, Go to the pine editor section, remove the default code, paste the downloaded code, save the file, and to chart

Stochastic Oscillator Algo Strategy

3: You can optimize your strategy by changing the input parameters, using “Settings” of Stochastic Oscillator Strategy.

Stochastic Oscillator Algo Strategy

Setting Up Alert

Before setting up an alert, make sure of few things.

(1) You have selected the desired script, timeframe, and strategy settings.

(2) API bridge is configured and running.

Once you have made sure, click on settings. Then add alert and paste {{strategy.order.comment}} in the message box. 

Important: do not change any settings during live trading.

NOTE: The pinescript works both with webhook alerts (TV Pro plan) and normal popup alerts (TV free plan).

Stochastic Oscillator Algo Strategy