Author: Yuriy Tokman
Profit factor:
0.65

This automated trading script is designed to identify and execute specific market movements based on price retracements within a chosen timeframe. Rather than reacting to every minor fluctuation, the logic focuses on detecting significant "pullbacks"—moments where the price moves against the current trend by a predefined amount before potentially continuing its path.

Core Trading Logic

The script monitors two primary scenarios to automate your trades:

1. Identifying Buy Opportunities (Long Positions) The system looks for instances where the market has shown upward momentum but experiences a temporary dip. Specifically, it checks if:

  • The current market price is lower than the price at which the current candle opened.
  • The price has pulled back from its highest point during that period by a specific distance (the "pips" setting) defined by the user. If both conditions are met, the script enters a Buy order, aiming to profit from the expected recovery.

2. Identifying Sell Opportunities (Short Positions) Conversely, the system looks for downward momentum followed by a temporary rally. It triggers a Sell order when:

  • The current market price is higher than the opening price of the current candle.
  • The price has rallied upward from its lowest point during that period by the same predefined distance. This logic captures opportunities to profit from the expected resumption of the downward trend.

Key Execution Features

To ensure smooth operation and risk management, the script includes several automated safeguards:

  • Trade Management: Every trade is automatically equipped with a Stop Loss (to limit potential losses) and a Take Profit (to secure gains at a specific target). The size of these targets, as well as the volume of each trade (Lot size), are fully customizable.
  • Single Execution Per Candle: To prevent the system from opening multiple repetitive trades on the same price movement, it includes a "New Bar" control. This ensures that the script only evaluates the market and executes a trade once at the start of a new time period (e.g., every new hour or minute, depending on your settings).
  • Visual Feedback: When a trade is successfully placed, the system provides immediate visual confirmation on the chart, marking Buy orders in green and Sell orders in red.

In summary, this script acts as an automated "rebound" trader, waiting for the market to breathe or pull back significantly before jumping in on the prevailing trend.

Price Data Components
Series array that contains open prices of each barSeries array that contains the highest prices of each barSeries array that contains the lowest prices of each bar
Orders Execution
It automatically opens orders when conditions are reached
7 Views
1 Downloads
0 Favorites
TST
//+------------------------------------------------------------------+
//|                                                          TST.mq4 |
//|                                                     Yuriy Tokman |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

extern int    StopLoss         = 500;           // Ðàçìåð ñòîïà â ïóíêòàõ
extern int    TakeProfit       = 100;           // Ðàçìåð òåéêà â ïóíêòàõ
extern double Lots             = 0.1;           // Ðàçìåð ëîòà

extern int timeframe           = 0;             // Âûáîð ÒÔ
extern int pips                = 500;           // Óñòàíîâëåííûé óðîâåíü îòêàòà
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   double bid  = MarketInfo(Symbol(),MODE_BID);
   double open = iOpen(Symbol(),timeframe,0);
   double high = iHigh(Symbol(),timeframe,0);
   double low  = iLow(Symbol(),timeframe,0);
//----
   if(open-bid>0 && high-bid>pips*Point)
    {
     if(NevBar())
     OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"TST",0,0,Green);
    }
   if(bid-open>0 && bid-low>pips*Point)
    {
     if(NevBar())      
     OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+StopLoss*Point,Bid-TakeProfit*Point,"TST",0,0,Red);
    }
//----
   return(0);
  }
//+----------------------------------------------------------------------------+
// Ôóíêöèÿ êîíòðîëÿ íîâîãî áàðà                                                |
//-----------------------------------------------------------------------------+
 bool NevBar()
  {
   static int PrevTime=0;
   if (PrevTime==Time[0]) return(false);
   PrevTime=Time[0];
   return(true);
  }

Profitability Reports

PERFORMANCE BY SYMBOL

Expected payoff

Average expected payoff across the available backtests for each symbol.

Positive Negative
16 reports
EUR/USD Jul 2025 - Sep 2025
2.80
Total Trades 77
Won Trades 72
Lost trades 5
Win Rate 93.51 %
Expected payoff 6.01
Gross Profit 720.00
Gross Loss -257.00
Total Net Profit 463.00
-100%
-50%
0%
50%
100%
GBP/CAD Oct 2025 - Feb 2026
2.30
Total Trades 27
Won Trades 25
Lost trades 2
Win Rate 92.59 %
Expected payoff 3.73
Gross Profit 178.34
Gross Loss -77.60
Total Net Profit 100.74
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.85
Total Trades 16
Won Trades 13
Lost trades 3
Win Rate 81.25 %
Expected payoff -1.46
Gross Profit 130.00
Gross Loss -153.30
Total Net Profit -23.30
-100%
-50%
0%
50%
100%
GBP/AUD Oct 2025 - Feb 2026
0.83
Total Trades 83
Won Trades 68
Lost trades 15
Win Rate 81.93 %
Expected payoff -1.16
Gross Profit 478.30
Gross Loss -574.98
Total Net Profit -96.68
-100%
-50%
0%
50%
100%
EUR/USD Oct 2025 - Feb 2026
0.78
Total Trades 5
Won Trades 4
Lost trades 1
Win Rate 80.00 %
Expected payoff -2.30
Gross Profit 40.00
Gross Loss -51.50
Total Net Profit -11.50
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.75
Total Trades 29
Won Trades 23
Lost trades 6
Win Rate 79.31 %
Expected payoff -2.68
Gross Profit 230.00
Gross Loss -307.80
Total Net Profit -77.80
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
0.40
Total Trades 31
Won Trades 21
Lost trades 10
Win Rate 67.74 %
Expected payoff -6.97
Gross Profit 142.65
Gross Loss -358.64
Total Net Profit -215.99
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.29
Total Trades 5
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -14.68
Gross Profit 30.00
Gross Loss -103.40
Total Net Profit -73.40
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.29
Total Trades 10
Won Trades 6
Lost trades 4
Win Rate 60.00 %
Expected payoff -10.35
Gross Profit 42.63
Gross Loss -146.16
Total Net Profit -103.53
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.29
Total Trades 5
Won Trades 3
Lost trades 2
Win Rate 60.00 %
Expected payoff -10.69
Gross Profit 21.81
Gross Loss -75.25
Total Net Profit -53.44
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.29
Total Trades 5
Won Trades 3
Lost trades 2
Win Rate 60.00 %
Expected payoff -18.29
Gross Profit 37.47
Gross Loss -128.90
Total Net Profit -91.43
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.24
Total Trades 25
Won Trades 15
Lost trades 10
Win Rate 60.00 %
Expected payoff -12.47
Gross Profit 97.68
Gross Loss -409.55
Total Net Profit -311.87
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.19
Total Trades 4
Won Trades 2
Lost trades 2
Win Rate 50.00 %
Expected payoff -20.85
Gross Profit 20.00
Gross Loss -103.40
Total Net Profit -83.40
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.16
Total Trades 18
Won Trades 9
Lost trades 9
Win Rate 50.00 %
Expected payoff -19.25
Gross Profit 64.30
Gross Loss -410.72
Total Net Profit -346.42
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.00
Total Trades 3
Won Trades 3
Lost trades 0
Win Rate 100.00 %
Expected payoff 10.00
Gross Profit 30.00
Gross Loss 0.00
Total Net Profit 30.00
-100%
-50%
0%
50%
100%
AUD/USD Oct 2025 - Feb 2026
0.00
Total Trades 2
Won Trades 2
Lost trades 0
Win Rate 100.00 %
Expected payoff 10.00
Gross Profit 20.00
Gross Loss 0.00
Total Net Profit 20.00
-100%
-50%
0%
50%
100%

Comments