kolbas_ch_EA

Profit factor:
26408.57

This script is designed to automatically place and manage pending and active trades in a trading platform. It works by setting up "buy stop" and "sell stop" orders based on the recent high and low prices of a specific trading instrument (like a currency pair).

Here's the breakdown of what it does, step-by-step:

  1. Setting the Stage (Initial Setup): The script starts by defining some adjustable settings, such as the size of the trades ("Lots"), how far the "trailing stop" should move ("TralUp"), how far away from the high/low price to place orders ("EnterFiltr"), and how far back in time to look for the high and low prices ("InHistory"). It also sets a fixed initial stop loss ("SL").

  2. Finding Highs and Lows: The script identifies the highest high and lowest low price of the trading instrument over a specified historical period. This range is determined by the 'InHistory' variable, allowing the script to consider a certain number of past price bars. The script considers the market spread (difference between buy and sell price) when placing buy orders.

  3. Placing Pending Orders: Based on these highs and lows, it automatically creates two types of pending orders:

    • Buy Stop Order: An order to automatically buy the instrument if the price reaches a level slightly above the recent high (defined using the 'EnterFiltr' variable). This anticipates the price continuing to rise if it breaks through the high.
    • Sell Stop Order: An order to automatically sell the instrument if the price falls to a level slightly below the recent low (defined using the 'EnterFiltr' variable). This anticipates the price continuing to fall if it breaks through the low.
    • The script only uses buy stop and sell stop orders and no buy limit and sell limit orders.
    • The script set's a Stop Loss for both Buy Stop and Sell Stop orders and the stop loss level is defined by the SL variable
  4. Managing Active Trades (Trailing Stop): The script also manages existing buy and sell trades. It checks if the trades are "profitable" (meaning the current price is moving in the desired direction after the trade was opened). If a trade is profitable, it adjusts the "stop loss" level to lock in profits. This is called a "trailing stop." The stop loss is moved closer to the current price as the price moves in a favorable direction. The Trailing stop adjustment is defined by the TralUp variable

  5. Trade Management Logic:

    • The script counts all active Buy and Sell orders with its magic number.
    • The script also counts all active Buy Stop and Sell Stop orders with its magic number.
    • If the script detects any active Buy and Sell orders, it will automatically delete all Buy Stop and Sell Stop orders. This is done to prevent conflicting orders.
    • Finally, the script checks that both the count of active Buy and Sell orders, and the count of active Buy Stop and Sell Stop orders are zero. If both are zero, it means that there are no active trades, and no pending orders, therefore the script places new Buy Stop and Sell Stop orders

In essence, this script aims to automatically enter trades based on price breakouts and manage those trades by using a trailing stop to secure profits as the price moves in a favorable direction.

Orders Execution
It automatically opens orders when conditions are reachedChecks for the total of open ordersIt can change open orders parameters, due to possible stepping strategy
4 Views
0 Downloads
0 Favorites
kolbas_ch_EA
//+------------------------------------------------------------------+
//|                                              kolbas ch by Maloma |
//+------------------------------------------------------------------+

#include <stdlib.mqh>
#include <stderror.mqh>

extern double Lots=0.1;
extern int    TralUp=11;
extern int    EnterFiltr=6;
extern int    InHistory=5;
extern double SL=45;
       int    StopLev;
       int    Tral;
       double MA, MAP;
       double Hich, Loch;
       int    i, CurTot, StopTot;      
        
int OpenOrders()
{
  Hich=High[Highest(Symbol(),NULL,MODE_HIGH,InHistory,0)]+(EnterFiltr+MarketInfo(Symbol(),MODE_SPREAD))*Point;
  Loch=Low[Lowest(Symbol(),NULL,MODE_LOW,InHistory,0)]-EnterFiltr*Point;
  OrderSend(Symbol(),OP_BUYSTOP,Lots,Hich,3,Hich-SL*Point,0,NULL,753,0,CLR_NONE);
  OrderSend(Symbol(),OP_SELLSTOP,Lots,Loch,3,Loch+SL*Point,0,NULL,753,0,CLR_NONE);
//  OrderSend(Symbol(),OP_SELLLIMIT,Lots,Bid+EnterFiltr*Point,3,Ask+2*EnterFiltr*Point,0,NULL,753,0,CLR_NONE);
//  OrderSend(Symbol(),OP_BUYLIMIT,Lots,Ask-EnterFiltr*Point,3,Bid-2*EnterFiltr*Point,0,NULL,753,0,CLR_NONE);
  return(0);
}

int start()
{ 
  StopLev=MarketInfo(Symbol(),MODE_STOPLEVEL);
  Tral=StopLev+TralUp;
  CurTot=0;
  StopTot=0;      
  for (i=0;i<OrdersTotal();i++)
    {
     OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
     if ((Symbol()==OrderSymbol())&&(OrderMagicNumber()==753)&&((OrderType()==OP_BUY)||(OrderType()==OP_SELL)))
       {
        CurTot++;
        if (OrderType()==OP_BUY)
          {
           if ((OrderOpenPrice()+Tral*Point)<Bid)
             {
              if ((OrderStopLoss()+Tral*Point)<Bid) {OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Tral*Point,Bid+Tral*Point,OrderExpiration(),CLR_NONE);}
             }
          }
        if (OrderType()==OP_SELL)
          {
           if (Ask<(OrderOpenPrice()-Tral*Point))
             {
              if (Ask<(OrderStopLoss()-Tral*Point)) {OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Tral*Point,Ask-Tral*Point,OrderExpiration(),CLR_NONE);}
             }
          }
       }
     if ((Symbol()==OrderSymbol())&&(OrderMagicNumber()==753)&&(OrderType()>1)) {StopTot++;}
    }
  for (i=0;i<OrdersTotal();i++)
    {
     OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
     if ((CurTot>0)&&(Symbol()==OrderSymbol())&&(OrderMagicNumber()==753)&&(OrderType()>1)) {OrderDelete(OrderTicket());}
    }  
  if ((CurTot==0)&&(StopTot==0)) {OpenOrders();}
  return(0);
}

Profitability Reports

EUR/USD Jul 2025 - Sep 2025
416845.13
Total Trades 2328
Won Trades 2225
Lost trades 103
Win Rate 95.58 %
Expected payoff 82992.80
Gross Profit 193207713.00
Gross Loss -463.50
Total Net Profit 193207249.50
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
209540.81
Total Trades 2630
Won Trades 2428
Lost trades 202
Win Rate 92.32 %
Expected payoff 72422.70
Gross Profit 190472597.20
Gross Loss -909.00
Total Net Profit 190471688.20
-100%
-50%
0%
50%
100%
EUR/USD Jan 2025 - Jul 2025
139128.48
Total Trades 5823
Won Trades 5197
Lost trades 626
Win Rate 89.25 %
Expected payoff 67229.42
Gross Profit 391479736.30
Gross Loss -2813.80
Total Net Profit 391476922.50
-100%
-50%
0%
50%
100%
AUD/USD Jan 2025 - Jul 2025
310.40
Total Trades 1638
Won Trades 1105
Lost trades 533
Win Rate 67.46 %
Expected payoff 453.05
Gross Profit 744491.00
Gross Loss -2398.50
Total Net Profit 742092.50
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
3.52
Total Trades 656
Won Trades 483
Lost trades 173
Win Rate 73.63 %
Expected payoff 2.03
Gross Profit 1861.51
Gross Loss -528.49
Total Net Profit 1333.02
-100%
-50%
0%
50%
100%
USD/JPY Jul 2025 - Sep 2025
2.72
Total Trades 1047
Won Trades 765
Lost trades 282
Win Rate 73.07 %
Expected payoff 1.41
Gross Profit 2340.97
Gross Loss -861.74
Total Net Profit 1479.23
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
2.16
Total Trades 2360
Won Trades 1590
Lost trades 770
Win Rate 67.37 %
Expected payoff 1.13
Gross Profit 4978.59
Gross Loss -2306.91
Total Net Profit 2671.68
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
1.85
Total Trades 837
Won Trades 589
Lost trades 248
Win Rate 70.37 %
Expected payoff 1.13
Gross Profit 2065.80
Gross Loss -1116.00
Total Net Profit 949.80
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
1.38
Total Trades 450
Won Trades 294
Lost trades 156
Win Rate 65.33 %
Expected payoff 0.74
Gross Profit 1208.59
Gross Loss -876.96
Total Net Profit 331.63
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
1.25
Total Trades 429
Won Trades 274
Lost trades 155
Win Rate 63.87 %
Expected payoff 0.40
Gross Profit 870.50
Gross Loss -697.50
Total Net Profit 173.00
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
1.10
Total Trades 427
Won Trades 258
Lost trades 169
Win Rate 60.42 %
Expected payoff 0.13
Gross Profit 608.82
Gross Loss -552.53
Total Net Profit 56.29
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
1.04
Total Trades 666
Won Trades 415
Lost trades 251
Win Rate 62.31 %
Expected payoff 0.08
Gross Profit 1461.20
Gross Loss -1409.94
Total Net Profit 51.26
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
1.03
Total Trades 890
Won Trades 572
Lost trades 318
Win Rate 64.27 %
Expected payoff 0.06
Gross Profit 1480.50
Gross Loss -1431.00
Total Net Profit 49.50
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.97
Total Trades 647
Won Trades 299
Lost trades 348
Win Rate 46.21 %
Expected payoff -0.06
Gross Profit 1094.04
Gross Loss -1132.38
Total Net Profit -38.34
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.89
Total Trades 665
Won Trades 407
Lost trades 258
Win Rate 61.20 %
Expected payoff -0.19
Gross Profit 1032.10
Gross Loss -1161.00
Total Net Profit -128.90
-100%
-50%
0%
50%
100%
USD/CAD Jan 2025 - Jul 2025
0.88
Total Trades 1742
Won Trades 991
Lost trades 751
Win Rate 56.89 %
Expected payoff -0.16
Gross Profit 2119.04
Gross Loss -2401.39
Total Net Profit -282.35
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.86
Total Trades 487
Won Trades 288
Lost trades 199
Win Rate 59.14 %
Expected payoff -0.26
Gross Profit 770.20
Gross Loss -895.50
Total Net Profit -125.30
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.80
Total Trades 687
Won Trades 392
Lost trades 295
Win Rate 57.06 %
Expected payoff -0.27
Gross Profit 776.30
Gross Loss -964.71
Total Net Profit -188.41
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.74
Total Trades 499
Won Trades 290
Lost trades 209
Win Rate 58.12 %
Expected payoff -0.35
Gross Profit 502.91
Gross Loss -675.29
Total Net Profit -172.38
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.67
Total Trades 737
Won Trades 419
Lost trades 318
Win Rate 56.85 %
Expected payoff -0.63
Gross Profit 964.50
Gross Loss -1431.00
Total Net Profit -466.50
-100%
-50%
0%
50%
100%
AUD/USD Oct 2024 - Jan 2025
0.59
Total Trades 735
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff -0.79
Gross Profit 844.30
Gross Loss -1422.00
Total Net Profit -577.70
-100%
-50%
0%
50%
100%
USD/CHF Jan 2025 - Jul 2025
0.47
Total Trades 1671
Won Trades 810
Lost trades 861
Win Rate 48.47 %
Expected payoff -1.43
Gross Profit 2127.15
Gross Loss -4509.36
Total Net Profit -2382.21
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.43
Total Trades 644
Won Trades 322
Lost trades 322
Win Rate 50.00 %
Expected payoff -1.28
Gross Profit 627.20
Gross Loss -1449.00
Total Net Profit -821.80
-100%
-50%
0%
50%
100%
GBP/AUD Jan 2025 - Jul 2025
0.15
Total Trades 4365
Won Trades 377
Lost trades 3988
Win Rate 8.64 %
Expected payoff -2.28
Gross Profit 1804.64
Gross Loss -11767.31
Total Net Profit -9962.67
-100%
-50%
0%
50%
100%
GBP/CAD Jan 2025 - Jul 2025
0.10
Total Trades 3714
Won Trades 326
Lost trades 3388
Win Rate 8.78 %
Expected payoff -2.68
Gross Profit 1058.52
Gross Loss -11021.31
Total Net Profit -9962.79
-100%
-50%
0%
50%
100%
NZD/USD Jan 2025 - Jul 2025
0.06
Total Trades 2651
Won Trades 301
Lost trades 2350
Win Rate 11.35 %
Expected payoff -3.77
Gross Profit 588.40
Gross Loss -10574.70
Total Net Profit -9986.30
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.04
Total Trades 3722
Won Trades 172
Lost trades 3550
Win Rate 4.62 %
Expected payoff -2.68
Gross Profit 435.08
Gross Loss -10399.15
Total Net Profit -9964.07
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.03
Total Trades 3625
Won Trades 144
Lost trades 3481
Win Rate 3.97 %
Expected payoff -2.75
Gross Profit 346.75
Gross Loss -10309.46
Total Net Profit -9962.71
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.00
Total Trades 3101
Won Trades 1
Lost trades 3100
Win Rate 0.03 %
Expected payoff -3.21
Gross Profit 6.00
Gross Loss -9969.33
Total Net Profit -9963.33
-100%
-50%
0%
50%
100%

Comments