Learn EAsiScript User Guide

Table of Contents

EAsiScript enables you to define sophisticated trading strategies through a clear and flexible syntax. At its core, EAsiScript uses expressions combining functions, operators, and indicators to drive trade decisions - from entry and exit points to stop losses and take profits. This guide will teach you step by step how to write effective scripts, with a focus on practical examples demonstrating key concepts like the ternary operator (?:), logical AND (&&), and logical OR (||) operators.

Disclaimer

The examples provided in this document are for educational purposes only and intended to demonstrate the functionality and application of EAsiScript. They have been generated as teaching examples and have not been tested in live market conditions. Before using any trading strategy, whether manually created or AI-generated:

  • Test thoroughly in a demo environment first
  • Validate across different market conditions and timeframes
  • Set appropriate position sizing and risk management parameters
  • Consider how the strategy may behave in extreme market conditions
  • Understand that past performance does not guarantee future results
  • Monitor strategy performance and be prepared to adjust parameters

Northen Trading Labs assumes no responsibility for any financial losses or other consequences arising from the use of these examples. Traders should develop their own testing procedures and risk management rules before deploying any strategy in a live trading environment.

The examples focus on demonstrating EAsiScript syntax and capabilities. A complete trading strategy requires additional considerations including:

  • Position sizing rules
  • Risk-reward requirements
  • Maximum drawdown limits
  • Market condition filters
  • Multiple timeframe analysis
  • Entry and exit confirmation rules

Basic Examples

These examples introduce fundamental EAsiScript concepts through simple, clear trading logic. Each example focuses on one key scripting technique, proper syntax, and function usage. Starting with built-in functions and basic price conditions, they provide the building blocks for more complex strategies. While intentionally simple, they follow best practices for bar referencing and decision making.

Example 1: Bar Direction

This example demonstrates how to use the BarTrend function to identify price direction.

Long Entry Script

BarTrend(1) == Bullish ? Ask() : 0

Purpose

Opens a buy trade when the last completed bar closes higher than it opened, showing a simple price direction filter.

Component Breakdown

  • Direction Check: BarTrend(1)
    • Analyzes the last completed bar (shift=1)
    • Returns Bullish (1) if close > open
  • Comparison: == Bullish
    • Checks if bar trend matches Bullish value
    • Uses predefined Bullish constant
  • Entry Price: Ask()
    • Returns current ask price if condition is met
    • 0 if condition is not met (no trade)

Key Points

  • Shows basic function usage with proper shift value
  • Demonstrates the ternary operator (?:)
  • Uses built-in constants
  • Implements clean entry logic

Note

This basic example can be enhanced by adding consecutive bar checks or volume confirmation.

Example 2: Price Range

This example shows how to use high and low price functions to identify trading ranges.

Long Entry Script

High(1) - Low(1) < ATR1(1) ? Ask() : 0

Purpose

Opens a buy trade when the last bar’s range is smaller than the average range, identifying potential consolidation periods.

Component Breakdown

  • Range Calculation: High(1) - Low(1)
    • Finds the last bar’s total range
    • Uses proper price functions
  • Comparison: < ATR1(1)
    • Compares to average true range
    • Identifies narrower than average bars
  • Entry Price: Ask()
    • Returns current ask price if condition is met
    • 0 if condition is not met (no trade)

Key Points

  • Shows price function usage
  • Demonstrates basic mathematical operations
  • Uses ATR for dynamic comparison
  • Implements range-based logic

Note

Ensure the ATR indicator is enabled in the Indicator’s List before running this script.

Example 3: Lower Highs

This example shows how to detect lower highs using the HH function.

Long Entry Script

HH(3) < HH(6) ? Ask() : 0

Purpose

Opens a buy trade when the highest high of the last 3 bars is lower than the highest high of the previous 3 bars, identifying a potential reversal point.

Component Breakdown

  • Recent High: HH(3)
    • Finds highest high of last 3 bars
    • Shows proper function usage
  • Prior High: HH(6)
    • Finds highest high of last 6 bars
    • Used to compare with recent period
  • Comparison: <
    • Confirms lower highs pattern
    • Shows proper operator usage

Key Points

  • Demonstrates HH function with different periods
  • Shows pattern detection technique
  • Uses clear comparison logic
  • Implements simple price analysis

Note

This basic pattern recognition can be used as a building block for more complex strategies.

Example 4: Volume Analysis

This example introduces basic volume analysis using the Volume function.

Long Entry Script

Volume(1) > Volume(2) * 1.5 ? Ask() : 0

Purpose

Opens a buy trade when the last bar’s volume is significantly higher than the previous bar’s volume, identifying increased market interest.

Component Breakdown

  • Current Volume: Volume(1)
    • Gets volume of last completed bar
    • Shows proper bar reference
  • Volume Increase: Volume(2) * 1.5
    • Compares to previous bar’s volume
    • Requires 50% volume increase
  • Entry Price: Ask()
    • Returns current ask price if condition is met
    • 0 if condition is not met (no trade)

Key Points

  • Shows Volume function usage
  • Demonstrates multiplication
  • Uses proper bar references
  • Implements volume-based logic

Note

Volume comparison provides a simple way to identify increased market activity.

Example 5: Cross Above Value

This example demonstrates how to detect when price crosses above a specific value.

Long Entry Script

Close(1) > MA1(1,0) && Close(2) <= MA1(2,0) ? Ask() : 0

Purpose

Opens a buy trade when price crosses above a moving average, showing basic cross detection.

Component Breakdown

  • Current Position: Close(1) > MA1(1,0)
    • Confirms price is above MA
    • Uses last completed bar
  • Previous Position: Close(2) <= MA1(2,0)
    • Confirms price was below MA
    • Uses bar before last
  • Entry Price: Ask()
    • Returns current ask price if conditions are met
    • 0 if conditions are not met (no trade)

Key Points

  • Shows proper cross detection technique
  • Demonstrates indicator value access
  • Uses multiple bar references
  • Implements basic AND logic

Note

Ensure the MA indicator is enabled in the Indicator’s List before running this script.

Example 6: High Pivot Detection

This example shows how to detect bars with strong bullish pivot patterns.

Long Entry Script

High(PP1(1,1,0,0xFFFFF)+1) <= High(1) ? Ask() : 0

Purpose

Opens a buy trade when the current bar’s high is greater than or equal to the high of the nearest pivot bar, indicating potential bullish reversal.

Component Breakdown

  • Pivot Reference: PP1(1,1,0,0xFFFFF)
    • Gets the shift to nearest high pivot bar
    • Buffer 1 = Pivot Order 1 shift values
    • Rotation 0 for high pivot shifts
    • Mask 0xFFFFF for lower 20 bits
  • High Comparison: High(PP1(1,1,0,0xFFFFF)+1) <= High(1)
    • Compares pivot high to current bar
    • +1 needed as PP1 returns shift from offset 1
  • Entry Price: Ask()
    • Returns current ask price if condition is met
    • 0 if condition is not met (no trade)

Key Points

  • Shows proper PP1 indicator usage
  • Demonstrates buffer and bit manipulation
  • Uses correct shift value adjustment
  • Implements pivot analysis logic

Note

Ensure the PP indicator is enabled in the Indicator’s List before running this script.

Example 7: RSI Level Check

This example shows how to check an indicator’s value against a threshold.

Long Entry Script

RSI1(1) < 30 ? Ask() : 0

Purpose

Opens a buy trade when RSI moves below 30, demonstrating simple oversold level detection.

Component Breakdown

  • RSI Check: RSI1(1)
    • Gets RSI value at last completed bar
    • Shows basic indicator value access
  • Threshold: < 30
    • Compares to oversold level
    • Uses simple comparison
  • Entry Price: Ask()
    • Returns current ask price if condition is met
    • 0 if condition is not met (no trade)

Key Points

  • Shows RSI indicator usage
  • Demonstrates value comparison
  • Uses proper bar reference
  • Implements level-based logic

Note

Ensure the RSI indicator is enabled in the Indicator’s List before running this script.

Example 8: Spread Check

This example demonstrates how to filter trades based on spread size.

Long Entry Script

Spread(1) <= ATR1(1) * 0.1 ? Ask() : 0

Purpose

Opens a buy trade when the spread is reasonable compared to average price movement, showing basic cost control.

Component Breakdown

  • Spread Size: Spread(1)
    • Gets spread at last completed bar
    • Shows spread function usage
  • Comparison: <= ATR1(1) * 0.1
    • Compares to 10% of ATR
    • Shows relative size check
  • Entry Price: Ask()
    • Returns current ask price if condition is met
    • 0 if condition is not met (no trade)

Key Points

  • Shows Spread function usage
  • Demonstrates relative comparison
  • Uses ATR for context
  • Implements cost-based filter

Note

Ensure the ATR indicator is enabled in the Indicator’s List before running this script.

Example 9: Time Filter

This example shows how to filter trades based on time of day.

Long Entry Script

TimeOfDay(9,30) ? Ask() : 0

Purpose

Opens a buy trade at exactly 9:30, demonstrating basic time-based entry rules.

Component Breakdown

  • Time Check: TimeOfDay(9,30)
    • Checks if current time is 9:30
    • Shows time function usage
  • Entry Price: Ask()
    • Returns current ask price if condition is met
    • 0 if condition is not met (no trade)

Key Points

  • Shows TimeOfDay function usage
  • Demonstrates time-based logic
  • Uses simple condition
  • Implements scheduling control

Note

Times are based on your broker’s server time. Verify the correct time zone for your trading session.

Example 10: Signal Check

This example shows how to use an indicator’s built-in signals.

Long Entry Script

Signal('ST1') == Bullish ? Ask() : 0

Purpose

Opens a buy trade when the SuperTrend indicator signals a bullish move, showing basic signal detection.

Component Breakdown

  • Signal Check: Signal('ST1')
    • Gets SuperTrend signal
    • Shows signal function usage
  • Comparison: == Bullish
    • Checks for bullish signal
    • Uses predefined constant
  • Entry Price: Ask()
    • Returns current ask price if condition is met
    • 0 if condition is not met (no trade)

Key Points

  • Shows Signal function usage
  • Demonstrates indicator signals
  • Uses proper comparison
  • Implements signal-based logic

Note

Ensure the SuperTrend (ST1) indicator is enabled in the Indicator’s List before running this script.

Intermediate Examples

These examples demonstrate how to construct more sophisticated trading strategies by combining multiple components and conditions. Each example shows a complete trade management approach, using all relevant scripts (entry, stop loss, trailing stop, take profit, and breakeven). While more complex than the Basic Examples, they maintain clear logic and focus on one key trading concept at a time. By studying these examples, you’ll learn how different EAsiScript components work together to create robust trading strategies and how various scripts interact during the lifecycle of a trade. You’ll also see practical implementations of risk management concepts and how to adapt your strategy to changing market conditions.

Example 1: Moving Average Trend Strategy

This example demonstrates a trend-following strategy that combines moving average trend with price position and dynamic trade management.

Long Entry Script

Trend('MA1') == Bullish && Close(1) > MA1(1,0) && Low(1) > MA1(1,0) ? Ask() : 0

Long Initial SL Script

MA1(1,0) - ATR1(1)

Long Trailing SL Script

MA1(1,0) - ATR1(1) * 0.5

Long TP Script

OrderPrice() + (OrderPrice() - SL()) * 2

Long BE Script

OrderPrice() + ATR1(1)

Purpose

Creates a trend-following strategy that enters when price shows clear bullish momentum above the moving average, with comprehensive trade management based on market volatility.

Component Breakdown

  • Entry Conditions
    • Trend('MA1') == Bullish: Confirms overall trend direction
    • Close(1) > MA1(1,0): Price closed above MA
    • Low(1) > MA1(1,0): Full bar above MA
  • Stop Loss Management
    • Initial: One ATR below MA for trend protection
    • Trailing: Half ATR below MA for closer tracking
  • Profit Targets
    • Take Profit: 2:1 reward-risk ratio
    • Breakeven: One ATR move in favor

Key Points

  • Shows complete trade management lifecycle
  • Demonstrates trend-following principles
  • Uses dynamic volatility-based adjustments
  • Implements proper risk-reward logic

Note

Ensure both MA and ATR indicators are enabled in the Indicator’s List. The MA period affects both trend detection and trade management.

Example 2: RSI Reversal Strategy

This example shows how to trade oversold conditions with confirmation and comprehensive trade management.

Long Entry Script

RSI1(1) < 30 && RSI1(1) > RSI1(2) && Close(1) > Open(1) ? Ask() : 0

Long Initial SL Script

Low(1) - ATR1(1)

Long Trailing SL Script

Low(1) - (ATR1(1) * (RSI1(1) < 50 ? 1 : 0.5))

Long TP Script

OrderPrice() + ATR1(1) * 3

Long BE Script

RSI1(1) > 50 ? OrderPrice() : 0

Purpose

Trades bullish reversals from oversold conditions, using RSI for entry confirmation and dynamic trade management based on both RSI and volatility conditions.

Component Breakdown

  • Entry Conditions
    • RSI1(1) < 30: Oversold condition
    • RSI1(1) > RSI1(2): RSI turning up
    • Close(1) > Open(1): Bullish price action
  • Stop Loss Management
    • Initial: One ATR below recent low
    • Trailing: Adapts to RSI position
  • Profit Targets
    • Take Profit: Three ATR target
    • Breakeven: When RSI crosses above 50

Key Points

  • Shows RSI-based reversal trading
  • Demonstrates adaptive trailing stop
  • Uses condition-based breakeven
  • Implements momentum-based exits

Note

Ensure both RSI and ATR indicators are enabled in the Indicator’s List. Consider adjusting RSI levels based on the specific instrument’s characteristics.

Example 3: Volatility Breakout Strategy

Long Entry Script

Close(1) > BB1(1,1) && Volume(1) > Volume(2) * 1.5 ? Ask() : 0

Long Initial SL Script

BB1(1,0) - ATR1(1)

Long Trailing SL Script

BB1(1,0)

Long TP Script

BB1(1,1) + (BB1(1,1) - BB1(1,0))

Long BE Script

OrderPrice() + ATR1(1)

Purpose

Trades breakouts from Bollinger Bands with volume confirmation, using the bands for dynamic trade management and profit targeting.

Component Breakdown

  • Entry Conditions
    • Close(1) > BB1(1,1): Price closes above upper band
    • Volume(1) > Volume(2) * 1.5: Increased volume confirms breakout
  • Stop Loss Management
    • Initial: One ATR below middle band
    • Trailing: Follows middle band
  • Profit Targets
    • Take Profit: Projects band width above upper band
    • Breakeven: One ATR move in favor

Key Points

  • Shows breakout trading technique
  • Demonstrates band-based management
  • Uses volume confirmation
  • Implements symmetric profit targets

Note

Ensure both Bollinger Bands and ATR indicators are enabled in the Indicator’s List. The strategy’s effectiveness depends on proper band settings for your timeframe.

Example 4: Support and Resistance Strategy

Long Entry Script

HLines1(1) > 0 && Close(1) > Signal('HLines1') && Volume(1) > Volume(2) ? Ask() : 0

Long Initial SL Script

Low(1) - ATR1(1)

Long Trailing SL Script

HLines1(1,0)

Long TP Script

OrderPrice() + (OrderPrice() - SL()) * 2

Long BE Script

High(1) > OrderPrice() + ATR1(1) ? OrderPrice() : 0

Purpose

Trades breakouts from horizontal support/resistance levels with volume confirmation and level-based management.

Component Breakdown

  • Entry Conditions
    • HLines1(1) > 0: Valid resistance level exists
    • Close(1) > Signal('HLines1'): Price breaks above level
    • Volume(1) > Volume(2): Volume confirms break
  • Stop Loss Management
    • Initial: One ATR below recent low
    • Trailing: Follows nearest support level
  • Profit Targets
    • Take Profit: 2:1 reward-risk ratio
    • Breakeven: After one ATR move

Key Points

  • Shows support/resistance trading
  • Demonstrates level-based exits
  • Uses volume confirmation
  • Implements proper risk management

Note

Ensure HLines and ATR indicators are enabled in the Indicator’s List. Level quality depends on proper HLines settings.

Example 5: Multi-Timeframe Momentum Strategy

Long Entry Script

Signal('RSI1') == Bullish && Close(1) > Close(2) ? Ask() : 0

Long Initial SL Script

Low(LL(3)) - ATR1(1)

Long Trailing SL Script

RSI1(1) > 70 ? High(1) - ATR1(1) * 0.5 : Low(1) - ATR1(1)

Long TP Script

OBOS('RSI1') == -1 ? Bid() : OrderPrice() + ATR1(1) * 3

Long BE Script

RSI1(1) > 60 ? OrderPrice() : 0

Purpose

Trades momentum signals with RSI, using overbought/oversold conditions for trade management.

Component Breakdown

  • Entry Conditions
    • Signal('RSI1') == Bullish: RSI momentum signal
    • Close(1) > Close(2): Price confirmation
  • Stop Loss Management
    • Initial: Below recent swing low plus ATR buffer
    • Trailing: Adapts to RSI conditions
  • Profit Targets
    • Take Profit: Dynamic based on RSI overbought
    • Breakeven: RSI above 60

Key Points

  • Shows momentum-based trading
  • Demonstrates condition-based exits
  • Uses indicator signals
  • Implements adaptive management

Note

Ensure RSI and ATR indicators are enabled in the Indicator’s List. Adjust RSI levels to suit your instrument’s characteristics.

Example 6: Fibonacci Retracement Strategy

Long Entry Script

Signal('AutoFib1') == Bullish && Ask() > FibPrice('AutoFib1',0.618) ? Ask() : 0

Long Initial SL Script

FibPrice('AutoFib1',0.382) - ATR1(1)

Long Trailing SL Script

FibPrice('AutoFib1',0.618)

Long TP Script

FibPrice('AutoFib1',1.0)

Long BE Script

FibPrice('AutoFib1',0.786)

Purpose

Trades bullish moves from Fibonacci retracement levels, using Fib levels for trade management.

Component Breakdown

  • Entry Conditions
    • Signal('AutoFib1') == Bullish: Fib pattern signal
    • Ask() > FibPrice('AutoFib1',0.618): Price above 0.618 level
  • Stop Loss Management
    • Initial: Below 0.382 level with ATR buffer
    • Trailing: Follows 0.618 level
  • Profit Targets
    • Take Profit: Full retracement (1.0 level)
    • Breakeven: After reaching 0.786 level

Key Points

  • Shows Fibonacci-based trading
  • Demonstrates level-based management
  • Uses pattern recognition
  • Implements measured moves

Note

Ensure AutoFib indicator is enabled in the Indicator’s List. Success depends on proper Fibonacci pattern identification.

Example 7: SuperTrend Early Reversal Strategy

Long Entry Script

Trend('ST1') == Bearish && Low(1) < ST1(1,0) && Close(1) > Open(1) ? Ask() : 0

Long Initial SL Script

Low(1) - ATR1(1)

Long Trailing SL Script

ST1(1,0)

Long TP Script

OrderPrice() + (OrderPrice() - SL()) * 2

Long BE Script

Trend('ST1') == Bullish ? OrderPrice() : 0

Purpose

Attempts to catch reversals by entering when price shows strength (bullish close) while still in a bearish SuperTrend, with confirmation from price testing the SuperTrend level.

Component Breakdown

  • Entry Conditions
    • Trend('ST1') == Bearish: Confirms we’re in bearish trend
    • Low(1) < ST1(1,0): Price has tested SuperTrend level
    • Close(1) > Open(1): Shows bullish pressure
  • Stop Loss Management
    • Initial: Below recent low with ATR buffer
    • Trailing: Follows SuperTrend line after entry
  • Profit Targets
    • Take Profit: 2:1 reward-risk ratio
    • Breakeven: When trend officially turns bullish

Example 8: Stochastic Cross Strategy

Long Entry Script

Stoch1(1,0) > Stoch1(1,1) && Stoch1(2,0) <= Stoch1(2,1) && Stoch1(1,0) < 30 ? Ask() : 0

Long Initial SL Script

Low(1) - ATR1(1)

Long Trailing SL Script

Low(1) - (ATR1(1) * (Stoch1(1,0) < 50 ? 1 : 0.5))

Long TP Script

OBOS('Stoch1') == -1 ? Bid() : OrderPrice() + ATR1(1) * 3

Long BE Script

Stoch1(1,0) > 50 ? OrderPrice() : 0

Purpose

Trades Stochastic crossovers in oversold territory, with adaptive trade management based on oscillator position.

Component Breakdown

  • Entry Conditions
    • Stoch1(1,0) > Stoch1(1,1): %K crosses above %D
    • Stoch1(2,0) <= Stoch1(2,1): Confirms new cross
    • Stoch1(1,0) < 30: In oversold territory
  • Stop Loss Management
    • Initial: One ATR below recent low
    • Trailing: Adapts to Stochastic position
  • Profit Targets
    • Take Profit: Exit on overbought or 3 ATR
    • Breakeven: Stochastic above centerline

Key Points

  • Shows oscillator cross trading
  • Demonstrates adaptive trailing
  • Uses oscillator zones
  • Implements momentum-based exits

Note

Ensure Stochastic and ATR indicators are enabled in the Indicator’s List.

Example 9: ADX Trend Strength Strategy

Long Entry Script

ADX1(1,0) > 25 && ADX1(1,2) > ADX1(1,1) && Close(1) > Open(1) ? Ask() : 0

Long Initial SL Script

Low(1) - (ATR1(1) * (ADX1(1,0) > 40 ? 2 : 1))

Long Trailing SL Script

Low(1) - ATR1(1) * (ADX1(1,0)/50)

Long TP Script

OrderPrice() + (ATR1(1) * (ADX1(1,0)/20))

Long BE Script

High(1) > OrderPrice() + ATR1(1) ? OrderPrice() : 0

Purpose

Trades strong trends identified by ADX, with strength-adjusted trade management.

Component Breakdown

  • Entry Conditions
    • ADX1(1,0) > 25: Strong trend exists
    • ADX1(1,2) > ADX1(1,1): Rising trend strength
    • Close(1) > Open(1): Bullish price action
  • Stop Loss Management
    • Initial: ATR-based, wider for stronger trends
    • Trailing: Dynamic based on ADX strength
  • Profit Targets
    • Take Profit: Scales with trend strength
    • Breakeven: After one ATR move

Key Points

  • Shows trend strength trading
  • Demonstrates strength-based adjustments
  • Uses dynamic scaling
  • Implements adaptive targets

Note

Ensure ADX and ATR indicators are enabled in the Indicator’s List.

Example 10: MACD Divergence Strategy

Long Entry Script

MACD1(1,0) < MACD1(3,0) && Low(1) > Low(3) && MACD1(1,0) < 0 && Close(1) > Open(1) ? Ask() : 0

Long Initial SL Script

Low(LL(5)) - ATR1(1)

Long Trailing SL Script

MACD1(1,0) > 0 ? Low(1) - ATR1(1) * 0.5 : Low(2) - ATR1(1)

Long TP Script

MACD1(1,0) > MACD1(2,0) ? OrderPrice() + ATR1(1) * 3 : OrderPrice() + ATR1(1) * 2

Long BE Script

MACD1(1,0) > 0 ? OrderPrice() : 0

Purpose

Trades bullish divergence between price and MACD, with momentum-based trade management.

Component Breakdown

  • Entry Conditions
    • MACD1(1,0) < MACD1(3,0): Lower MACD low
    • Low(1) > Low(3): Higher price low
    • MACD1(1,0) < 0: Below zero line
    • Close(1) > Open(1): Bullish confirmation
  • Stop Loss Management
    • Initial: Below recent swing low with buffer
    • Trailing: Tighter when MACD positive
  • Profit Targets
    • Take Profit: Adapts to MACD momentum
    • Breakeven: When MACD crosses above zero

Key Points

  • Shows divergence detection
  • Demonstrates momentum-based management
  • Uses multiple confirmations
  • Implements adaptive profit targets

Note

Ensure MACD and ATR indicators are enabled in the Indicator’s List. Consider adjusting the lookback period (3 bars) based on your timeframe.

Advanced Examples (Complete Strategies)

These examples present fully-formed trading strategies that demonstrate how to combine multiple components into comprehensive trading systems. Each example includes complete script sets with sophisticated entry conditions, dynamic trade management, and risk controls. They show how to integrate multiple timeframes, combine various indicators, and adapt to changing market conditions. While more complex than the Intermediate Examples, they maintain clear logic and documentation to serve as templates for both manual adaptation and AI-assisted customization. These strategies also demonstrate different trading approaches including trend-following, mean reversion, breakout trading, and pattern recognition, providing a broad foundation for developing your own advanced trading systems.

Example 1: Multi-Timeframe Trend Strategy (EURUSD M15)

UserVAR Definitions

VAR0=2;1,1.5,2,2.5,3 // SL ATR multiplier VAR1=4;2,3,4,5,6 // TP ATR multiplier

Indicator Creation Strings

NTL\MA(1,50,1).ex5,0,1,2 NTL\RSI(1,14,1,70,30).ex5,0,1 NTL\RSI(:H1,1,14,1,70,30).ex5,0,1 NTL\ATR(1,14).ex5,0

Long Entry Script

TimeOfDay(8,0,17,0) == 0 && Trend('MA1') == Bullish && Close(1) > MA1(1,0) && RSI1(1) > 50 && RSI2(1) > 50 ? Ask() : 0

Long Initial SL Script

MA1(1,0) - (ATR1(1) * VAR0)

Long Trailing SL Script

MA1(1,0) - (ATR1(1) * (RSI1(1) > 70 ? 0.5 : 1))

Long TP Script

OrderPrice() + (ATR1(1) * VAR1 * (RSI2(1) > 70 ? 1 : 2))

Long BE Script

RSI1(1) > 60 && RSI2(1) > 60 ? OrderPrice() : 0

Long Exit Script

TimeOfDay(17,0) == 1 || (RSI1(1) < 40 && RSI2(1) < 40) ? Bid() : 0

Purpose

A comprehensive trend-following strategy for EURUSD that aligns M15 and H1 timeframes with momentum confirmation and time-based filters, using adaptive trade management based on market conditions.

Component Breakdown

  • Entry Conditions
    • TimeOfDay(8,0,17,0) == 0: Trading window
    • Trend('MA1') == Bullish: Current timeframe trend
    • Close(1) > MA1(1,0): Price above MA
    • RSI1(1) > 50: M15 momentum
    • RSI2(1) > 50: H1 momentum
  • Trade Management
    • Initial Stop: Variable ATR-based using VAR0
    • Trailing Stop: Adapts to overbought conditions
    • Take Profit: Scales with H1 momentum
    • Breakeven: Requires momentum on both timeframes
  • Exit Rules
    • Time-based exit at 17:00
    • Momentum-based exit when both timeframes weak

Key Points

  • Shows multi-timeframe analysis
  • Uses UserVARs for optimization
  • Implements complete risk management
  • Trading window control

Note

All indicators must be enabled (’+’ prefix) in the preset file. Strategy performs best during major session overlaps.

Example 2: Price Action Reversal Strategy (GBPUSD M30)

UserVAR Definitions

VAR0=3;1.5,2,2.5,3,3.5,4 // TP extension multiplier

Indicator Creation Strings

NTL\ATR(1,14).ex5,0 NTL\PP(1).ex5,0,1,2,3,4,5 NTL\BB(1,20,2.0).ex5,0,1,2,3

Long Entry Script

High(PP1(1,2,0,0xFFFFF)+1) < High(1) && OBOS('BB1') == 1 && Close(1) > Open(1) ? Ask() : 0

Long Initial SL Script

Low(PP1(1,2,20,0xFFFFF)+1) - ATR1(1)

Long Trailing SL Script

Low(2) - ATR1(1) * (BB1(1,0) < BB1(2,0) ? 1.5 : 1)

Long TP Script

BB1(1,1) + ATR1(1) * VAR0

Long BE Script

High(1) > OrderPrice() + ATR1(1) * 2 ? OrderPrice() : 0

Long Exit Script

OBOS('BB1') == -1 || Close(1) < BB1(1,0) ? Bid() : 0

Purpose

Identifies potential reversals in GBPUSD using pivot points and Bollinger Band oversold conditions, with adaptive trade management based on volatility.

Component Breakdown

  • Entry Conditions
    • High(PP1(1,2,0,0xFFFFF)+1) < High(1): New high above pivot point
    • OBOS('BB1') == 1: Oversold condition
    • Close(1) > Open(1): Bullish confirmation
  • Trade Management
    • Initial Stop: Below referenced pivot low
    • Trailing Stop: Adapts to Bollinger Band direction
    • Take Profit: Upper band plus ATR multiple
    • Breakeven: After significant move in favor

Key Points

  • Best performance during London session
  • Shows proper pivot point analysis
  • Demonstrates complex buffer access
  • Uses oversold conditions for entry

Note

Strategy performs best during periods of high volatility but clear price structure. Most effective in the early London session when GBPUSD typically shows strong directional moves.

Example 3: Asian Session Range Strategy (USDJPY M30)

UserVAR Definitions

VAR0=0.5;0.3,0.4,0.5,0.6,0.7 // Range size filter (in ATR) VAR1=2;1.5,2,2.5,3 // Breakout target multiplier

Indicator Creation Strings

NTL\ATR(1,14).ex5,0 NTL\ABH(1,14,3).ex5,0,1 NTL\PP(1).ex5,0,1,2,3,4,5

Long Entry Script

TimeOfDay(4,0) && (High(1) - Low(1)) < ATR1(1) * VAR0 && Volume(1) > Volume(2) ? Ask() : 0

Long Initial SL Script

Low(1) - ATR1(1)

Long Trailing SL Script

Low(2) - ATR1(1) * (ABH1(1,0) > ABH1(2,0) ? 1.5 : 1)

Long TP Script

OrderPrice() + (ATR1(1) * VAR1)

Long BE Script

High(1) > OrderPrice() + ATR1(1) ? OrderPrice() : 0

Long Exit Script

TimeOfDay(8,0) || PP1(1,0) > 0 ? Bid() : 0

Purpose

Capitalizes on USDJPY’s characteristic early Asian session consolidation followed by breakout moves, using time filters and volatility measures.

Component Breakdown

  • Entry Conditions
    • TimeOfDay(4,0): Early Asian session
    • (High(1) - Low(1)) < ATR1(1) * VAR0: Compressed range
    • Volume(1) > Volume(2): Volume confirmation
  • Trade Management
    • Initial Stop: One ATR below entry bar
    • Trailing Stop: Adapts to bar height changes
    • Take Profit: Multiple of ATR
    • Breakeven: After one ATR move
  • Exit Rules
    • Time-based exit at Tokyo lunch (8:00)
    • Pivot point formation triggers exit

Key Points

  • Specifically designed for Asian session
  • Uses volatility compression signals
  • Implements session-based timing
  • Adapts to changing volatility conditions

Note

Strategy targets the characteristic USDJPY behavior during Asian hours. Most effective during Tuesday-Thursday Asian sessions when liquidity is optimal.

Example 4: London Breakout Strategy (EURGBP H1)

UserVAR Definitions

VAR0=2.5;1.5,2.0,2.5,3.0,3.5 // Range multiplier VAR1=1.5;1.0,1.5,2.0,2.5 // Risk-reward ratio

Indicator Creation Strings

NTL\ATR(1,14).ex5,0 NTL\BB(1,20,2.0).ex5,0,1,2,3 NTL\MA(1,50,1).ex5,0,1,2

Long Entry Script

TimeOfDay(7,0) && High(1) > HH(Range(6,0,"",D1)/Point) && Trend('MA1') == Bullish ? Ask() : 0

Long Initial SL Script

Low(1) - ATR1(1) * VAR0

Long Trailing SL Script

BB1(1,0) - ATR1(1)

Long TP Script

OrderPrice() + ((OrderPrice() - SL()) * VAR1)

Long BE Script

High(1) > OrderPrice() + ((OrderPrice() - SL()) * 0.5) ? OrderPrice() : 0

Long Exit Script

TimeOfDay(16,0) || (BB1(1,1) < BB1(2,1) && Close(1) < Open(1)) ? Bid() : 0

Purpose

Takes advantage of the typical London session breakout in EURGBP, entering on breaks of the Asian range with trend confirmation.

Component Breakdown

  • Entry Conditions
    • TimeOfDay(7,0): London session open
    • High(1) > HH(Range(6,0,"",D1)/Point): Breaks Asian range
    • Trend('MA1') == Bullish: Trend confirmation
  • Trade Management
    • Initial Stop: Multiple of ATR
    • Trailing Stop: Below Bollinger middle band
    • Take Profit: Based on risk-reward ratio
    • Breakeven: After 50% move to target
  • Exit Rules
    • Time-based exit before US close
    • Exit on band contraction with bearish price

Key Points

  • Captures London session volatility
  • Uses Asian range for reference
  • Implements trend-following concept
  • Dynamic position sizing via ATR

Note

Best results during Tuesday-Thursday when both London and European markets are fully active. Avoid trading on UK and European bank holidays.

Example 5: MACD Double-Zero Strategy (USDCAD H4)

UserVAR Definitions

VAR0=2;1.5,2,2.5,3 // Initial stop multiplier VAR1=0.5;0.3,0.4,0.5,0.6,0.7 // Trailing factor

Indicator Creation Strings

NTL\MACD(1,12,26,9).ex5,0,1,2,3,4 NTL\ATR(1,14).ex5,0 NTL\RSI(1,14,1,70,30).ex5,0,1

Long Entry Script

MACD1(1,0) > 0 && MACD1(2,0) <= 0 && RSI1(1) > 50 && Mid() < Round(Mid()) + 0.01 ? Ask() : 0

Long Initial SL Script

Low(1) - ATR1(1) * VAR0

Long Trailing SL Script

Low(1) - ATR1(1) * (MACD1(1,0) > MACD1(2,0) ? VAR1 : VAR1 * 2)

Long TP Script

Round(Mid()) + 0.01 + (ATR1(1) * 2)

Long BE Script

MACD1(1,0) > MACD1(1,1) * 2 ? OrderPrice() : 0

Long Exit Script

MACD1(1,0) < 0 || RSI1(1) > 70 ? Bid() : 0

Purpose

Takes advantage of USDCAD’s tendency to react around ‘double-zero’ levels (e.g., 1.3200, 1.3300), combining it with momentum confirmation.

Component Breakdown

  • Entry Conditions
    • MACD1(1,0) > 0 && MACD1(2,0) <= 0: MACD crosses zero
    • RSI1(1) > 50: Momentum confirmation
    • Mid() < Round(Mid()) + 0.01: Near round number
  • Trade Management
    • Initial Stop: ATR-based with multiplier
    • Trailing Stop: Adapts to MACD momentum
    • Take Profit: Next round number + 2 ATR
    • Breakeven: On strong MACD expansion
  • Exit Rules
    • MACD turns negative
    • RSI overbought condition

Key Points

  • Uses psychological price levels
  • Combines momentum with price structure
  • Implements dynamic trailing stops
  • Adapts to market volatility

Note

Strategy performs best during North American session when USDCAD typically shows clearest reactions to psychological levels. Avoid during Canadian economic news releases.

Example 6: Channel Breakout Strategy (AUDUSD H1)

UserVar Definitions

VAR0=15;10,15,20,25,30 // Channel lookback period VAR1=1.5;1.0,1.5,2.0,2.5 // Risk-reward ratio

Indicator Creation Strings

NTL\ATR(1,14).ex5,0 NTL\Keltner(1,20,1,2.25).ex5,0,1,2,3

Long Entry Script

High(1) > HH(VAR0) && Volume(1) > Volume(2) * 1.5 && High(1) > Keltner1(1,1) ? Ask() : 0

Long Initial SL Script

Keltner1(1,0) - ATR1(1)

Long Trailing SL Script

Keltner1(1,0) - (ATR1(1) * 0.5)

Long TP Script

OrderPrice() + ((OrderPrice() - SL()) * VAR1)

Long BE Script

High(1) > HH(VAR0) + ATR1(1) ? OrderPrice() : 0

Long Exit Script

Close(1) < Keltner1(1,0) || Low(1) < LL(5) ? Bid() : 0

Purpose

Trades breakouts from established price channels in AUDUSD, using volume confirmation and Keltner Channels for validation and management.

Component Breakdown

  • Entry Conditions
    • High(1) > HH(VAR0): Breaks channel high
    • Volume(1) > Volume(2) * 1.5: Volume surge
    • High(1) > Keltner1(1,1): Above Keltner upper band
  • Trade Management
    • Initial Stop: Below Keltner middle band
    • Trailing Stop: Half ATR below middle band
    • Take Profit: Based on risk-reward ratio
    • Breakeven: After channel extension
  • Exit Rules
    • Price below Keltner middle band
    • Breaks recent swing low

Key Points

  • Adapts to market volatility
  • Uses volume for confirmation
  • Implements channel-based management
  • Dynamic position sizing

Note

Most effective during Asian-London crossover when AUDUSD often forms and breaks clear channels. Avoid during RBA announcements and significant Chinese economic data releases.

Example 7: Opening Range Breakout Strategy (EURJPY M15)

UserVAR Definitions

VAR0=2;1.5,2,2.5,3 // ATR multiplier for targets

Indicator Creation Strings

NTL\ATR(1,14).ex5,0 NTL\ABH(1,14,3).ex5,0,1

Long Entry Script

TimeOfDay(9,0) == -1 && High(1) > HH(4) && Volume(1) > Volume(2) ? Ask() : 0

Long Initial SL Script

LL(4) - ATR1(1)

Long Trailing SL Script

Low(1) - (ABH1(1,0) * (High(1) > HH(3) ? 1 : 2))

Long TP Script

OrderPrice() + (ATR1(1) * VAR0)

Long BE Script

High(1) > OrderPrice() + ATR1(1) ? OrderPrice() : 0

Long Exit Script

TimeOfDay(16,0) == 1 || Low(1) < LL(3) ? Bid() : 0

Purpose

Trades breakouts from the London session opening range in EURJPY, using adaptive targets based on volatility.

Component Breakdown

  • Entry Conditions
    • TimeOfDay(9,0) == -1: After the opening range hour
    • High(1) > HH(4): Breaks opening hour’s high
    • Volume(1) > Volume(2): Volume confirmation
  • Trade Management
    • Initial Stop: Below opening hour’s low with ATR buffer
    • Trailing Stop: Based on average bar height
    • Take Profit: Multiple of ATR
    • Breakeven: After one ATR move
  • Exit Rules
    • Time-based exit at 16:00
    • Break of recent lows

Key Points

  • Uses session-specific timing
  • Adapts to daily volatility
  • Dynamic range calculation
  • Volume-based confirmation

Note

Designed for London session volatility in EURJPY. Best results Tuesday-Thursday, avoid during major Japanese holidays or during BOJ/ECB announcements.

Example 8: Pattern Break Strategy (USDCHF M30)

UserVar Definitions

VAR0=3;2,3,4,5 // Minimum pattern strength VAR1=2;1.5,2,2.5,3 // Risk multiplier

Indicator Creation Strings

NTL\ATR(1,14).ex5,0 NTL\JCP(1).ex5,0,1 NTL\BB(1,20,2.0).ex5,0,1,2,3

Long Entry Script

Signal('JCP1') == Bullish && OBOS('BB1') == 1 && High(1) > High(2) ? Ask() : 0

Long Initial SL Script

Low(1) - (ATR1(1) * VAR1)

Long Trailing SL Script

Low(1) - (ATR1(1) * (BB1(1,0) < BB1(2,0) ? 2 : 1))

Long TP Script

BB1(1,1) + ATR1(1) * 2

Long BE Script

Close(1) > BB1(1,1) ? OrderPrice() : 0

Long Exit Script

Signal('JCP1') == Bearish || Close(1) < BB1(1,0) ? Bid() : 0

Purpose

Combines Japanese candlestick patterns with Bollinger Band oversold conditions in USDCHF, focusing on pattern-based reversals.

Component Breakdown

  • Entry Conditions
    • Signal('JCP1') == Bullish: Bullish candlestick pattern
    • OBOS('BB1') == 1: Oversold condition
    • High(1) > High(2): Pattern confirmation
  • Trade Management
    • Initial Stop: ATR-based with multiplier
    • Trailing Stop: Adapts to BB slope
    • Take Profit: Upper band plus 2 ATR
    • Breakeven: On upper band break
  • Exit Rules
    • Bearish pattern forms
    • Close below middle band

Key Points

  • Uses candle pattern recognition
  • Combines with band conditions
  • Dynamic stop adjustment
  • Multiple confirmation approach

Note

Most effective during European session when USDCHF typically shows clearest pattern formations. Avoid during SNB announcements and major Swiss economic releases.

Example 9: Triple Moving Average Strategy (GBPUSD H4)

UserVAR Definitions

VAR0=1.5;1.0,1.5,2.0,2.5 // ATR multiplier for stops VAR1=2.5;2.0,2.5,3.0,3.5 // Target multiplier

Indicator Creation Strings

NTL\MA(:H4,1,10,1,20,1).ex5,0,1,2 NTL\MA(:H4,1,50,1).ex5,0,1 NTL\BB(1,20,2.0).ex5,0,1,2,3 NTL\ATR(1,14).ex5,0

Long Entry Script

MA1(1,0) > MA1(1,1) && MA1(1,1) > MA2(1,0) && Close(1) > BB1(1,1) ? Ask() : 0

Long Initial SL Script

Low(1) - (ATR1(1) * VAR0)

Long Trailing SL Script

MA1(1,1) - (ATR1(1) * (MA1(1,0) > MA1(2,0) ? 0.5 : 1))

Long TP Script

OrderPrice() + (ATR1(1) * VAR1 * (BB1(1,1) > BB1(2,1) ? 1.5 : 1))

Long BE Script

High(1) > OrderPrice() + ATR1(1) ? OrderPrice() : 0

Long Exit Script

MA1(1,0) < MA1(1,1) || Close(1) < BB1(1,0) ? Bid() : 0

Purpose

Uses three moving averages in correct alignment with Bollinger Band confirmation for trend trading in GBPUSD.

Component Breakdown

  • Entry Conditions
    • MA1(1,0) > MA1(1,1): 10-period MA above 20-period MA
    • MA1(1,1) > MA2(1,0): 20-period MA above 50-period MA
    • Close(1) > BB1(1,1): Price above upper band
  • Trade Management
    • Initial Stop: ATR-based with multiplier
    • Trailing Stop: Uses 50-period MA with ATR adjustment
    • Take Profit: Dynamic based on band expansion
    • Breakeven: After one ATR move

Key Points

  • Uses triple MA alignment
  • Implements volatility-based exits
  • Dynamic trade management
  • Multiple confirmations required

Note

Strategy works best during trending phases of GBPUSD H4. Avoid during major UK/US news releases and during periods of low volatility.

Example 10: Trading Range Strategy (NZDUSD H4)

UserVAR Definitions

VAR0=0.5;0.3,0.4,0.5,0.6,0.7 // Range comparison factor VAR1=1.5;1.0,1.5,2.0,2.5 // Risk multiple for target

Indicator Creation Strings

NTL\ATR(1,14).ex5,0 NTL\BB(1,20,2.0).ex5,0,1,2,3 NTL\HLines(1,'',800,64,'S2;R2',2,0.3,0.5,100).ex5,0,1

Long Entry Script

(High(3) - Low(3)) < ATR1(1) * VAR0 && Signal('HLines1') == Bullish && OBOS('BB1') == 1 ? Ask() : 0

Long Initial SL Script

Low(3) - ATR1(1)

Long Trailing SL Script

BB1(1,0) - (ATR1(1) * 0.5)

Long TP Script

OrderPrice() + ((OrderPrice() - SL()) * VAR1)

Long BE Script

High(1) > OrderPrice() + ATR1(1) ? OrderPrice() : 0

Long Exit Script

OBOS('BB1') == -1 || Signal('HLines1') == Bearish ? Bid() : 0

Purpose

Trades contractions in price range near support levels, combining HLines support/resistance with Bollinger Band conditions.

Component Breakdown

  • Entry Conditions
    • (High(3) - Low(3)) < ATR1(1) * VAR0: Range contraction
    • Signal('HLines1') == Bullish: Support level signal
    • OBOS('BB1') == 1: Oversold condition
  • Trade Management
    • Initial Stop: Below range low with ATR buffer
    • Trailing Stop: Below middle band
    • Take Profit: Based on risk multiple
    • Breakeven: After one ATR move

Key Points

  • Uses range contraction for entry
  • Combines multiple indicators
  • Dynamic position sizing
  • Support/resistance confirmation

Note

Best suited for NZDUSD H4 during Asian/early London hours when price tends to respect ranges more clearly. Avoid during major NZ/US news releases.

Best Practices for Writing Scripts

When writing scripts in EAsiScript, following established coding practices will help you create more reliable and maintainable trading strategies. These best practices focus on proper syntax, correct use of variables and functions, and clear logical structure. By following these guidelines, you’ll avoid common coding errors and create scripts that are easier to test and modify.

  1. Use Provided Variables:
  • Replace raw values like 1 or -1 with the predefined variables Bullish and Bearish:

    • Bullish = 1: Indicates a buy signal or bullish trend.
    • Bearish = -1: Indicates a sell signal or bearish trend.

    Example: Signal('MA1') == Bullish ? Ask() : 0

  1. Leverage the Point Variable for Scaling:

    • Always multiply numeric adjustments by Point to ensure they are scaled correctly according to the symbol’s price units.

    Example: ATR1(1) > 15 ? Low(1) - 20 * Point : Low(1) - 10 * Point

  2. Explicitly Define Shifts for Functions:

    • Functions like Close, Open, High, and Low require a shift parameter. The default is 1, but specifying it explicitly improves clarity.

    Example: Close(1) > Open(1) ? Ask() : 0

  3. Avoid Invalid Functions:

    • Use valid functions like SL() instead of invalid ones like StopLoss().
    • Valid Functions: Ask(), Bid(), SL(), Signal(), Trend().
    • Invalid Examples: StopLoss(), Price().
  4. Combine Indicators and Price Data:

    • Create powerful scripts by combining indicator signals with price conditions.

    Example: Trend('MA1') == Bullish && Close(1) > Open(1) ? Ask() : 0

Tips for Writing Scripts

Before diving into script writing, it’s helpful to understand some practical approaches that can make your development process smoother and more effective. While the Best Practices section covers the technical aspects of writing scripts, these tips focus on the development process itself, common pitfalls to avoid, and strategies for testing and implementing your trading logic. Whether you’re writing your first script or developing complex strategies, these guidelines will help you build more reliable and maintainable trading systems.

  1. Test Individual Components First
  • Write and test entry conditions separately before combining
  • Verify indicator signals independently
  • Test time filters alone before adding to strategies
  1. Common Mistakes to Avoid
  • Don’t forget to enable indicators in the Indicators List
  • Remember shift=1 means last completed bar, not current bar
  • Check you’re using Ask() for buys and Bid() for sells
  1. Debugging Tips
  • Use single conditions first, then build up with AND (&&)
  • Test time windows with simple entry conditions
  • Verify indicator buffer numbers match your settings
  1. Development Process
  • Start with entry logic
  • Add initial stop loss
  • Test basic exits
  • Add trailing stops and breakeven last
  • Fine-tune with take profit levels
  1. Risk Management
  • Always test stop loss logic independently
  • Verify SL is appropriate distance from entry
  • Test breakeven conditions thoroughly
  1. Performance Tips
  • Keep conditions as simple as needed
  • Use appropriate timeframes for indicators
  • Consider market hours for your strategy

Use AI to Create an EAsiScript Preset File

EAsiScript enables you to leverage artificial intelligence for creating preset files and developing trading strategies. By providing AI with your strategy requirements and the EAsiTrader documentation, you can generate compliant preset files that are ready for testing and optimization. This approach combines the efficiency of AI with your trading expertise, allowing you to rapidly develop and refine strategies while maintaining full control over their implementation and risk management.

The key to successful AI-assisted development is providing clear strategy requirements and ensuring the AI has access to all necessary documentation. This section will guide you through the process of preparing your requirements, working with AI to generate preset files, and properly testing the resulting strategies.

1. Prepare Your Strategy Details

Before engaging with AI, clearly define the specifics of your trading strategy:

  • Entry and Exit Rules: Conditions for opening and closing trades
  • Risk Management: Stop loss, take profit, breakeven levels, or trailing stops
  • Indicators: Specify indicators like RSI, Moving Averages, or ATR
  • Special Conditions: Add any time-based filters, multi-symbol requirements, or other specific needs

2. Upload the User Guides to AI

Provide AI with the foundational documentation:

  • EAsiTrader User Guide: Core functionality and settings
  • EAsiScript User Guide: Scripting language and functions
  • Learn EAsiScript Guide: Examples and best practices

These guides contain all the information AI needs to generate accurate scripts and ensure compliance with EAsiTrader’s requirements.

3. Ask AI to Create Your Preset

Provide your strategy requirements in a clear, structured format:

  • Specify it must comply with “Rules for Creating Main Preset Files”
  • Use Defaults.set as template
  • Request verification against the template
  • Include specific symbols and timeframes
  • Detail any optimization requirements

4. Save the Generated Content

  • Copy AI-generated output to a plain text editor
  • Save with a descriptive name and .set extension (e.g., TrendFollowing.set)
  • Verify proper formatting and section structure

5. Copy the Preset File to the EAsiTrader Folder

  • Locate your MetaTrader data folder path:
    • MQL5\Files\EAsiTrader
  • Place the .set file in this directory
  • The preset will appear in EAsiTrader’s Profile Dropdown

6. Load the Preset

  • Open EAsiTrader in MetaTrader 5
  • Select your new preset from the Profile Dropdown
  • Verify all settings loaded correctly
  • Verify required indicators are enabled

7. Test the Preset

  • Use EAsiTrader’s Tester feature
  • Start with visual backtesting
  • Verify entry/exit logic
  • Check risk management behavior
  • Test in different market conditions

8. Activate for Live Trading

  • Complete thorough testing first
  • Enable Auto Trading in EAsiTrader
  • Monitor initial trades closely
  • Keep detailed performance records

9. Iterate and Optimise

  • Review strategy performance
  • Identify areas for improvement
  • Generate new variations using AI
  • Optimise parameters using Tester

AI Prompt Examples

These examples demonstrate effective AI prompts for generating EAsiTrader preset files and trading strategies. Each example includes the exact text you should give to the AI, formatted with specific requirements and the mandatory preset file compliance instructions.

CRITICAL: INCLUDE THESE INSTRUCTIONS WITH EVERY PROMPT

When providing any of these example prompts to AI, you MUST include these exact instructions as part of your prompt:

“The preset file must strictly comply with all the ‘Rules for
Creating EAsiTrader Preset Files’. Use the Defaults.set Preset File as
a template. Verify your content by cross referencing your sections and
settings with those from the template. Any deviation or omission
will be considered a failure to complete the task
.”

⚠️ WARNING: Omitting these instructions from your prompt will likely result in invalid preset files that will not work correctly in EAsiTrader. Remember that the AI cannot see or access these instructions unless you explicitly include them in your prompt.

Each example below shows a complete prompt that you can copy and use directly with AI. Pay attention to how the required instructions are integrated with the strategy specifications in each prompt.

Example 1: Basic Strategy

Copy this complete prompt:

"Create an EAsiScript preset file for a strategy based on RSI levels.

The preset file must strictly comply with all the ‘Rules for
Creating EAsiTrader Preset Files’. Use the Defaults.set Preset File as
a template. Verify your content by cross referencing your sections and
settings with those from the template. Any deviation or omission
will be considered a failure to complete the task
.

Strategy Details

  • Entry: Go long when RSI crosses above 30, go short when RSI crosses below 70
  • Stop Loss: 2 times ATR below/above entry price for long/short trades
  • Take Profit: Fixed at 50 points for all trades
  • Exit: Close trade if the opposite RSI condition occurs
  • Execution: Runs on EURUSD on the M30 timeframe"

Example 2: Trend-Following Strategy

Copy this complete prompt:

"Please create an EAsiScript Preset File for a strategy using multiple
moving averages.

The preset file must strictly comply with all the ‘Rules for
Creating EAsiTrader Preset Files’. Use the Defaults.set Preset File as
a template. Verify your content by cross referencing your sections and
settings with those from the template. Any deviation or omission
will be considered a failure to complete the task
.

Strategy Details

  • Entry: Enter when fast MA crosses above slow MA with RSI confirmation
  • Stop Loss: Set below recent swing low with ATR buffer
  • Take Profit: Use ATR to calculate 3:1 reward:risk ratio
  • Exit: Exit if MA cross reverses or RSI conditions change
  • Execution: GBPUSD, H1 timeframe"

Example 3: Complex Multi-Timeframe Strategy

Copy this complete prompt:

"Generate an EAsiScript Preset File for a complete trading system.

The preset file must strictly comply with all the ‘Rules for
Creating EAsiTrader Preset Files’. Use the Defaults.set Preset File as
a template. Verify your content by cross referencing your sections and
settings with those from the template. Any deviation or omission
will be considered a failure to complete the task
.

Strategy Details

  • Markets: EURUSD, Primary M15, Secondary H1
  • Entry Conditions:
    • H1 trend alignment (using MA)
    • M15 momentum confirmation (using RSI)
    • Volume confirmation
  • Risk Management:
    • Dynamic ATR-based stops
    • Trailing stop after breakeven
    • Multiple take profit targets
  • Time Filters: Active during London/NY overlap
  • Position Sizing: Risk 1% per trade"

Example 4: Breakout Strategy

Copy this complete prompt:

"Generate an EAsiScript Preset File for a Bollinger Band breakout
strategy.

The preset file must strictly comply with all the ‘Rules for
Creating EAsiTrader Preset Files’. Use the Defaults.set Preset File as
a template. Verify your content by cross referencing your sections and
settings with those from the template. Any deviation or omission
will be considered a failure to complete the task
.

Strategy Details

  • Entry: Go long if price breaks above upper band with volume surge
  • Stop Loss: Use trailing stop based on 2 ATR
  • Take Profit: Use 5% of account equity as target profit
  • Exit: Close position if price re-enters the bands
  • Execution: GBPUSD, H1 timeframe, with risk of 1% per trade"

Example 5: Mean Reversion Strategy

Copy this complete prompt:

"Help me create an EAsiScript Preset File for a mean reversion
strategy.

The preset file must strictly comply with all the ‘Rules for
Creating EAsiTrader Preset Files’. Use the Defaults.set Preset File as
a template. Verify your content by cross referencing your sections and
settings with those from the template. Any deviation or omission
will be considered a failure to complete the task
.

Strategy Details

  • Entry: Enter long when RSI below 30 and returns above it
  • Stop Loss: Place at low of last 5 bars
  • Take Profit: Target twice the stop-loss distance
  • Exit: Exit on MA cross or RSI above 70
  • Execution: USDJPY, M15 timeframe"

Example 6: Asian Session Range Strategy

Copy this complete prompt:

"Create a preset for trading the Asian session range breakout.

The preset file must strictly comply with all the ‘Rules for
Creating EAsiTrader Preset Files’. Use the Defaults.set Preset File as
a template. Verify your content by cross referencing your sections and
settings with those from the template. Any deviation or omission
will be considered a failure to complete the task
.

Strategy Details

  • Symbol: USDJPY M30
  • Range Definition: 00:00-03:00 Tokyo
  • Entry: Break of range high/low after range formation
  • Filters: Minimum range size using ATR
  • Risk: Dynamic based on range size
  • Exit: Before Tokyo lunch or at 1:1 reward:risk"

Example 7: Support/Resistance Strategy

Copy this complete prompt:

"Create a preset for trading key support/resistance levels.

The preset file must strictly comply with all the ‘Rules for
Creating EAsiTrader Preset Files’. Use the Defaults.set Preset File as
a template. Verify your content by cross referencing your sections and
settings with those from the template. Any deviation or omission
will be considered a failure to complete the task
.

Strategy Details

  • Symbol: EURGBP H1
  • Indicator: HLines for dynamic S/R levels
  • Entry: Reversal candle at S/R with RSI confirmation
  • Stop Loss: Beyond the S/R level plus buffer
  • Take Profit: Distance to next S/R level
  • Filters: Minimum distance between levels using ATR
  • Time: Active during London session only"

Example 8: Double Zero Level Strategy

Copy this complete prompt:

"Generate a preset for trading psychological price levels.

The preset file must strictly comply with all the ‘Rules for
Creating EAsiTrader Preset Files’. Use the Defaults.set Preset File as
a template. Verify your content by cross referencing your sections and
settings with those from the template. Any deviation or omission
will be considered a failure to complete the task
.

Strategy Details

  • Symbol: USDCAD H4
  • Entry: Reversal at 00 levels (1.3200, 1.3300, etc.)
  • Confirmation: MACD cross and minimum volume
  • Stop Loss: ATR-based beyond the level
  • Management: Trail stop to breakeven after 20 pips
  • Risk: 1% per trade, scaled by distance to stop"

Visit the EAsiTrader Presets Page for more examples which you can download to use in EAsiTrader.

Rev:07.02.2025 10:35