OPEN-SOURCE SCRIPT

AMD Trading Strategy

45
This Pine Script implements a trading strategy based on the AMD Model (Accumulation, Manipulation, Distribution), segmented across three main trading sessions:

Asia Session (00:00 - 08:00 GMT)

London Session (08:00 - 16:00 GMT)

New York Session (16:00 - 23:59 GMT)

1️⃣ Session Detection
The script first defines the time ranges for each major market session using timestamp:

Asia: 00:00 to 08:00 GMT

London: 08:00 to 16:00 GMT

New York: 16:00 to 23:59 GMT

It then checks the current time against these ranges to see which session is active (is_asia, is_london, is_newyork).

2️⃣ Buy and Sell Signals
The script calculates:

Buy Signal:

During the Asia session, if the current high is greater than the previous high (high > high[1]).

During the London session, if the current low is less than the previous low (low < low[1]).

Sell Signal:

During the New York session, if the closing price is lower than the previous close (close < close[1]).

These signals are plotted on the chart:

Green BUY label below the candle when a Buy condition is met.

Red SELL label above the candle when a Sell condition is met.

3️⃣ Take Profit Calculation
A dynamic Take Profit Level is calculated:

The TP level is set to 0.5% above the current closing price.

This level is plotted as a blue line for visual reference.

4️⃣ Error Handling
Basic error handling is in place:

If there is missing data (na values) in the high, low, or close, it drops a red label on the chart indicating a "Data Issue".

5️⃣ Multi-Timeframe Support
The script allows you to visualize the strategy in different timeframes:

You can select a timeframe (15m, 1h, 4h, etc.) through the input options.

The price is plotted as a gray line for multi-timeframe reference.

Summary
This script:

Identifies key trading sessions (Asia, London, New York).

Generates Buy and Sell signals based on specific price movements within each session.

Plots a Take Profit line to visualize exit opportunities.

Supports multiple timeframes for broader analysis.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.