You have to use Moving Averages Crossover indicator to simulate alligator.
Alligator Jaw is a Smoothed MA (Period 13, Shift 8) based on the Median price.
Teeth is MA (8, 5)
Lips is MA (5, 3)
So for the condition "Back three bars I want the lips to be below the teeth", you can set:
[Opening Logic Condition]
Moving Averages Crossover
The Fast MA is lower than the Slow MA
Base price - Median
Fast MA method - Smoothed
Slow MA method - Smoothed
Fast MA period - 5
Slow MA period - 8
Fast MA shift - 5
Slow MA shift - 7
Use previous bar value - Yes
Here Fast MA is the Lips but shifted with 2 bars. FastMA (period 5, shift 3+2)
Slow MA is Teeth shifted 2 bars also. Slow MA (8, 7)
"second bar bact to have the lips above the teeth"
[Opening Logic Condition]
Moving Averages Crossover
The Fast MA is higher than the Slow MA
Base price - Median
Fast MA method - Smoothed
Slow MA method - Smoothed
Fast MA period - 5
Slow MA period - 8
Fast MA shift - 4
Slow MA shift - 6
Use previous bar value - Yes
"on the current bar for the lips to be above the jaw"
This is: Fast MA (5,3) is higher than Slow MA (13, 8)
The whole strategy will be:
[Opening Point of the Position]
Bar Opening
Enter the market at the beginning of the bar
Base price - Open
[Opening Logic Condition]
Moving Averages Crossover
The Fast MA is lower than the Slow MA
Base price - Median
Fast MA method - Smoothed
Slow MA method - Smoothed
Fast MA period - 5
Slow MA period - 8
Fast MA shift - 5
Slow MA shift - 7
Use previous bar value - Yes
[Opening Logic Condition]
Moving Averages Crossover
The Fast MA is higher than the Slow MA
Base price - Median
Fast MA method - Smoothed
Slow MA method - Smoothed
Fast MA period - 5
Slow MA period - 8
Fast MA shift - 4
Slow MA shift - 6
Use previous bar value - Yes
[Opening Logic Condition]
Moving Averages Crossover
The Fast MA is higher than the Slow MA
Base price - Median
Fast MA method - Smoothed
Slow MA method - Smoothed
Fast MA period - 5
Slow MA period - 13
Fast MA shift - 3
Slow MA shift - 8
Use previous bar value - Yes
[Closing Point of the Position]
Close and Reverse
Close all positions and open a new one in the opposite direction