//@version=4
strategy("My Script")
if year > 2014 and year < 2016
strategy.entry("Buy", strategy.long, oca_name="My oca", oca_type=strategy.oca.reduce)
strategy.exit("FromBy", "Buy", profit=100, loss=200, oca_name="My oca")
strategy.entry("Sell", strategy.short, oca_name="My oca", oca_type=strategy.oca.cancel)
strategy.order("Order", strategy.short, oca_name="My oca", oca_type=strategy.oca.none)
Overview
My Script enters a long using one-cancels-all reduce, then attaches an exit with a profit target of 100 and a stop loss of 200. It also submits a short entry using OCA cancel and a short order using OCA none. There are no user inputs. Results appear in a separate pane. It does not define position sizing.
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
HA UnivLong&Short Futures calculates Heikin Ashi candles and builds a channel using simple moving averages of Heikin Ashi highs and lows. It enters long positions when the upper channel line crosses above the lower channel line and opens short positions on the
This strategy combines the ATR-banded Q-Trend indicator with the Klinger Volume Oscillator (KVO) to execute confluence trades. It enters long when a Q-Trend buy trigger aligns with a positive KVO value and a bullish candle confirmation, taking short trades und
This strategy calculates the Moving Average Convergence Divergence indicator and plots the MACD line, signal line, and histogram in a separate pane. It enters long positions when the MACD line crosses above the signal line and enters short positions when it cr
This strategy estimates price behavior using ordinary least squares regression between higher-timeframe data and a generated dataset, smoothed by a Karobein oscillator. It enters long positions when the oscillator turns upward and short positions when it turns
10PreBuyer is a dip-buying strategy that submits limit orders below recent price action using a discounted Hull Moving Average (HMA). It calculates the highest HMA value of high prices over a selected period, multiplied by a percentage discount factor, and pla
This pair trading strategy calculates the daily price movement ratio of Google using multi-symbol data requests and plots it in a separate pane. When Google drops by more than 5% within a day, the strategy enters a long position of 100 units on the chart symbo