It should not allow any new trade or exit (long or short) to be triggered unless ADX is first above 20 before the trigger occurs.
It also should hold positions throughout the day but not hold any positions overnight.
Assistance is greatly appreciated.}
{062713 TRP and TS Support Convert Aroon Oscillator to Strategy}
{ Reference: Tushar S. Chande, "A Time Price Oscillator", Technical Analysis of
Stocks & Commodities, V. 13:9 (369-374) }
inputs:
int AroonLength( 25 ) ; // Aroon length
{
Started with the built-in Aroon Oscillator indicator. Converted it to a strategy
by:
1) Remove all plot statements - these do not work in strategies
2) Converting Alerts to entries or exits
}
// Calc the Aroon Oscillator value using the built-in AroonOsc function
AroonOscValue = AroonOsc( AroonLength ) ;
// Check that we are past the first bar of the chart to prevent spurious entries
if CurrentBar > 1 then begin
// Cross over zero triggers long entry or reversal from short to long
if AroonOscValue crosses over 0 then
if ADX >20
Buy at next bar at market
// Cross under zero triggers short entry or reversal from long to short
else if AroonOscValue crosses under 0 then
if ADX =>20
SellShort at next bar at market ;