UpDn-Alexander Piechotta-30

Profit factor:
30.10

This script is designed to automatically place and manage trades in a financial market, likely forex or stocks, based on a specific technical indicator called "Bulls Power." Here's a breakdown of how it works:

1. Setting the Stage:

  • The script starts by defining several adjustable parameters:
    • TakeProfit: This determines how much profit the script aims to make on each trade, measured in points (a unit of price movement).
    • Lots: This defines the size of the trades the script will make.
    • TrailingStop: This is a safety net that automatically adjusts the stop-loss level as the price moves in a favorable direction, locking in profits.
    • StopLoss: This sets the maximum amount of money the script is willing to lose on a trade.

2. Reading the Market:

  • The script constantly monitors the market using the "Bulls Power" indicator. This indicator is a tool that attempts to gauge the strength of buyers in the market.
  • It looks at the "Bulls Power" value at two different points in time: the previous bar and the current bar.

3. Managing Existing Trades:

  • Closing Losing Positions: If the "Bulls Power" indicates a weakening buying trend (previous Bulls Power is higher than the current) the script first tries to close existing buy orders (hoping to close winning positions using a trailing stop).
  • Closing Winning Positions: Similarly, if the "Bulls Power" suggests a bearish market, the script attempts to close existing sell orders (using trailing stops).

4. Opening New Trades:

  • The script opens new trades only if it doesn't already have an open trade.
  • Selling: If the "Bulls Power" reading suggests weakening buying pressure (previous higher than current) and the current value is above zero, the script will place a sell order.
  • Buying: If the "Bulls Power" indicator shows a negative value, suggesting strong potential for a price increase, the script will place a buy order.

5. Order Execution:

  • When the script decides to open a trade, it sends an order to the trading platform.
  • The order includes:
    • The direction of the trade (buy or sell).
    • The size of the trade (Lots).
    • The stop-loss level (StopLoss).
    • The take-profit level (TakeProfit).

In essence, this script automatically analyzes the market using the "Bulls Power" indicator and places trades based on its readings, aiming to profit from short-term price movements while attempting to limit potential losses.

Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reached
Indicators Used
Bulls Power indicator
11 Views
0 Downloads
0 Favorites
UpDn-Alexander Piechotta-30
//+------------------------------------------------------------------+
extern double TakeProfit = 7; 
extern double Lots = 0.1; 
extern double TrailingStop = 5; 
extern double StopLoss = 30; 

int start() 
{ 
double pos1pre=0; 
double  pos2cur=0; 
int cnt=0; 
int mode=0; 
double openpozprice=0; 




pos1pre = iBullsPower(NULL,0,1,PRICE_WEIGHTED,1); 
pos2cur = iBullsPower(NULL,0,1,PRICE_WEIGHTED,0); 
//Comment("??????? ???????  ",pos2cur,"Previous pos", pos1pre ); 

if (pos1pre >pos2cur) { 
//????????? ??????? ??????? 

for (cnt=1; cnt<OrdersTotal(); cnt++) 

{ 

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); 
        if( OrderSymbol()==Symbol() && OrderType()==OP_BUY ) 


         { 
         if (Bid>(OrderOpenPrice()+TrailingStop*Point)) 
     { 
       OrderClose(OrderTicket(),OrderLots(),Bid,5,Violet); 
     return(0); 
         } 
         } 
  } 
} 


if (pos2cur<0) 
//????????? ???????? ??????? 

{ 

for (cnt=1; cnt<OrdersTotal(); cnt++) 
{ 


OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); 
      if( OrderSymbol()==Symbol() && OrderType()==OP_SELL ) 
         { 

   if (Ask< (OrderOpenPrice()-TrailingStop*Point)) 
         { 
                    OrderClose(OrderTicket(),OrderLots(),Ask,5,Violet); 
     return(0); 
           }       } 
      } 
} 


if (OrdersTotal() < 1 ) 
{ 

Print("pos1pre = "+pos1pre+"    pos2cur ="+pos2cur); 
if (pos1pre>pos2cur && pos2cur>0)       { 

int ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Bid-TakeProfit*Point,"",0,0,Gold); 
            return(0); 
    } 
   // ????????? ?? ??????????? ?????? ? ??????? ??????? (BUY) 

if (pos2cur<0)   { 
// print("K = "+K+"   S ="+S); 
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+TakeProfit*Point,"",0,0,Gold); 
    return(0); 
   } 
  } 

} 

Profitability Reports

USD/JPY Jul 2025 - Sep 2025
0.05
Total Trades 40
Won Trades 39
Lost trades 1
Win Rate 97.50 %
Expected payoff -8.50
Gross Profit 19.11
Gross Loss -359.11
Total Net Profit -340.00
-100%
-50%
0%
50%
100%
USD/CHF Jul 2025 - Sep 2025
0.37
Total Trades 30
Won Trades 29
Lost trades 1
Win Rate 96.67 %
Expected payoff -1.47
Gross Profit 25.76
Gross Loss -69.91
Total Net Profit -44.15
-100%
-50%
0%
50%
100%
USD/CAD Jul 2025 - Sep 2025
0.05
Total Trades 17
Won Trades 16
Lost trades 1
Win Rate 94.12 %
Expected payoff -9.80
Gross Profit 8.28
Gross Loss -174.88
Total Net Profit -166.60
-100%
-50%
0%
50%
100%
NZD/USD Jul 2025 - Sep 2025
0.78
Total Trades 94
Won Trades 93
Lost trades 1
Win Rate 98.94 %
Expected payoff -0.19
Gross Profit 65.10
Gross Loss -83.20
Total Net Profit -18.10
-100%
-50%
0%
50%
100%
GBP/USD Jul 2025 - Sep 2025
0.36
Total Trades 213
Won Trades 212
Lost trades 1
Win Rate 99.53 %
Expected payoff -1.24
Gross Profit 148.40
Gross Loss -413.10
Total Net Profit -264.70
-100%
-50%
0%
50%
100%
GBP/CAD Jul 2025 - Sep 2025
0.14
Total Trades 91
Won Trades 90
Lost trades 1
Win Rate 98.90 %
Expected payoff -3.17
Gross Profit 45.51
Gross Loss -334.20
Total Net Profit -288.69
-100%
-50%
0%
50%
100%
GBP/AUD Jul 2025 - Sep 2025
0.42
Total Trades 97
Won Trades 96
Lost trades 1
Win Rate 98.97 %
Expected payoff -0.63
Gross Profit 44.34
Gross Loss -105.14
Total Net Profit -60.80
-100%
-50%
0%
50%
100%
EUR/USD Jul 2025 - Sep 2025
0.00
Total Trades 37
Won Trades 36
Lost trades 1
Win Rate 97.30 %
Expected payoff -2851.80
Gross Profit 25.20
Gross Loss -105541.70
Total Net Profit -105516.50
-100%
-50%
0%
50%
100%
AUD/USD Jul 2025 - Sep 2025
0.23
Total Trades 66
Won Trades 65
Lost trades 1
Win Rate 98.48 %
Expected payoff -2.30
Gross Profit 45.50
Gross Loss -197.10
Total Net Profit -151.60
-100%
-50%
0%
50%
100%
USD/JPY Jan 2025 - Jul 2025
1.57
Total Trades 942
Won Trades 941
Lost trades 1
Win Rate 99.89 %
Expected payoff 0.17
Gross Profit 444.18
Gross Loss -283.64
Total Net Profit 160.54
-100%
-50%
0%
50%
100%

Comments