Reply To: adding lowest low to swing parameter formulae query

Optuma Forums Optuma Scripting adding lowest low to swing parameter formulae query Reply To: adding lowest low to swing parameter formulae query

#50395
Trevor R
  • Topics: 109
  • Replies: 319
  • Posts: 428

Hi Tim,

As I understand your requirements, you wish to enter if the High of the Bar following the “Lowest Low” crosses above the High of the Lowest Low bar.

Identifying a Lower Swing Low than previous Swing Low is relatively easy:

// ———————

// TRB Lower Gann Swing Low

// Define Gann Swing properties: 2 Bar Swing

GS =GANNSWING(DEFAULT=SwingList, SWINGCOUNT=2, METHOD=Use Next Bar, USEINSIDE=False, USECLUSTERS=False, USEBREAKOUT=False);

// Define Swing ends

SE0 = SWINGEND(GS)[0];

SE1 = SWINGEND(GS)[1];

SE2 = SWINGEND(GS)[2];

// Test that Target Swing end is a Low Swing End

SE0Low =SE0 < SE1;

// Test that SE0 is lower than SE2

SE0Lower = SE0 < SE2;

// Test for Lower Low Signal

SignalLowerLo = SE0Low and SE0Lower;

SignalLowerLo

// ———————

You will note that the above Script does NOT identify the Low of the Last Bar on the chart as a Swing Low, even though it is lower than the 2-Day Swing Low preceding it (see the screenshot below). It cannot identify this Bar as a Lower Swing Low because no Swing Up has yet occurred to confirm it as a SwingEnd.

Now, the more difficult part, that is identifying what you consider the “Lowest Swing Low”. Is it:

  • Simply a Swing Low below the previous Swing Low – as identified by the above Script;
  • A 2-Day Swing Low coincident with Weekly (Monthly) Swing Low below the previous Weekly (Monthly) Swing High and/or previous Weekly (Monthly) Swing Low;
  • The Lowest 2-Day Swing Low in the past 30/60/90/… Days; or
  • Some other criteria?

Once the criteria for “Lowest Swing Low” (let’s make it a variable called “LowestSWLow”) is determined and the Script code for it developed and included with the above code, the test for the Lower Low Signal would become:

// ———————

// Test for Lower Low Signal

SignalLowerLo = SE0Low and SE0Lower and LowestSWLow;

SignalLowerLo

// ———————

Now, if you wish to enter immediately after the SignalLowerLo, ie when the High of the SignalLowerLo Bar is crossed above, the following code will do that:

// ———————

// UP ENTRY BARS

// Use the following for highlighting the Entry Bar with no gap, allow outside bar

UpBar0 = (HIGH(0) > HIGH(1)) AND (LOW(0) <= HIGH(1) );

EntrySignal = (TIMESINCESIGNAL(SignalLowerLo) =1) AND UpBar0;

EntrySignal

// ———————

Which brings us to a final code listing that will identify the Entry Bar that immediately follows the Lower Low Signal (but without it being the, as yet undefined, LowerSwLow):

// ———————

// TRB Lower Gann Swing Low & Entry

// Define Gann Swing properties: 2 Bar SwingGS =GANNSWING(DEFAULT=SwingList, SWINGCOUNT=2, METHOD=Use Next Bar, USEINSIDE=False, USECLUSTERS=False, USEBREAKOUT=False);

// Define Swing ends

SE0 = SWINGEND(GS)[0];

SE1 = SWINGEND(GS)[1];

SE2 = SWINGEND(GS)[2];

// Test that Target Swing end is a Low Swing End

SE0Low =SE0 < SE1;

// Test that SE0 is lower than SE2

SE0Lower = SE0 < SE2;

// Test for Lower Swing Low

SignalLowerLo = SE0Low and SE0Lower;

//UP ENTRY BARS

// Use the following for highlighting the Entry Bar with no gap, allow outside bar

UpBar0 = (HIGH(0) > HIGH(1)) AND (LOW(0) <= HIGH(1) );

EntrySignal = (TIMESINCESIGNAL(SignalLowerLo) =1) AND UpBar0;

EntrySignal

// ———————

If you apply the first and last scripts to SHOWBARs you will be able to identify the Lower Lows (Fuchsia) and the Entry Bars (Green) that follow them, as can be seen in the following screenshot with a Dotted 2-Day Gann Swing Overlay: 20181214 Lower Swing Low Scripting You’ll note that in the above screen shot there is one Lower Low (Fuchsia) NOT followed by and Entry Signal (Green) – that’s because the Bar after the Lower Low signal is an Inside Bar (ie lower High) and only the bar immediately following the Lower Low signal is considered for entry purposes. Hopes this helps in you exploration of Optuma scripting.

Cheers

Trevor

The Auld Tyma at

Auld Tyma Data Logo 0

https://auldtymadata.com/

 

 

Pin It on Pinterest