jgtstrategies

JGT Strategies repo

Alligator Mouth State and Water State Documentation

This document provides an overview of the Alligator Mouth State and Water State used in the trading strategy implemented in the jgwill/jgtstrategies repository. These states are determined based on the positions of the Alligator’s Jaw, Teeth, and Lips lines, as well as the price relative to these lines.

Alligator Mouth State

The Alligator Mouth State is determined by analyzing the positions of the Alligator’s Jaw, Teeth, and Lips lines. These lines are calculated using the ALLIGATOR indicator. The Jaw, Teeth, and Lips lines are represented by al.Jaw[period], al.Teeth[period], and al.Lips[period] respectively in the code.

Possible States

(Still has issues in understanding that the direction of the trend determined the states and reverses the logics but that sequences is interesting to show the sequence of the states)

Possible Phases

The function parse_mouth_dir_state in strategies/standard/xptoDSPrep231124v5.lua determines the direction and state of the Alligator’s mouth based on these conditions.

Water State

The Water State is determined by the position of the price relative to the Alligator’s mouth and the state of the Alligator’s mouth. The function parse_mouth_bs_state_barpos__water in strategies/standard/xptoDSPrep231124v5.lua implements this logic.

Possible Values

Functions

parse_mouth_dir_state

This function determines the direction and state of the Alligator’s mouth based on the positions of the Jaw, Teeth, and Lips lines. It returns the mouth direction (buy, sell, or neither) and the mouth state (open, closed, opening, or none).

parse_mouth_bs_state_barpos__water

This function determines the position of the price relative to the Alligator’s mouth and the water state. It returns the price mouth position (in or out) and the water state (splashing, eating, throwing, poping, entering, or switching).

signal_alligator_mouth_state_changed

This function handles the change in state of the Alligator’s mouth. It is used to signal when the Alligator’s mouth state changes, which can be used for making trading decisions.

Output Values

The output values for the Alligator Mouth State and Water State are:

These values are essential for making trading decisions based on the Alligator indicator.

Alligator Indicator Overview

The Alligator Indicator is a technical analysis tool used to identify market trends and potential reversals. It consists of three lines: the Jaw, Teeth, and Lips.

Jaw Line

The Jaw line is a 13-period Smoothed Moving Average (SMMA) shifted by 8 periods into the future. It acts as a support or resistance level.

Teeth Line

The Teeth line is an 8-period Smoothed Moving Average (SMMA) shifted by 5 periods into the future. It provides additional confirmation of the trend.

Lips Line

The Lips line is a 5-period Smoothed Moving Average (SMMA) shifted by 3 periods into the future. It is the most sensitive to price changes.

Possible States and Phases

The Alligator Indicator identifies the following states:

The Alligator Indicator also identifies the following phases:

Market Conditions

The market is either advancing or not advancing (oscillating). The interaction between the Alligator Mouth State and the Water State involves analyzing the positions of the Alligator’s Jaw, Teeth, and Lips lines, as well as the price relative to these lines. Contradictions can occur when the market is oscillating, making it difficult to determine a clear direction.

For more detailed information, refer to the ALLIGATOR_MOUTH_STATE.md file.