SLR_MoneyRain

Download script
Profit factor:
0.00

This automated trading script is designed to manage and execute trades on the MetaTrader platform by reacting to specific price movements. It follows a logic centered around identifying market volatility and managing a set of active positions to capitalize on small price fluctuations.

Core Trading Mechanism

The script operates by constantly monitoring the current market price against the prices at which it last "checked" the market.

  • Entry Logic: The system looks for a specific minimum price movement (defined as a "Shift"). If the price moves in favor of a potential sell position or against a potential buy position by this amount, it opens a trade.
  • Position Management: The script limits the total number of open trades at any given time to ensure the account is not over-exposed to a single direction.

Profit and Loss Handling

The system includes automated rules for when to exit a trade based on two primary targets:

  1. Profit Taking: If a trade reaches a predefined small profit margin (the "Take" value), the script will automatically close that position to secure the gain.
  2. Stop Loss/Risk Management: The script also monitors trades that move against the desired direction. If a trade loses beyond a specific limit (the "Limit" value), the script identifies it as a loss and closes it immediately to prevent further capital erosion.

Dynamic Position Sizing

A key feature of this script is its ability to calculate how much money to risk on each new trade.

  • Reinvestment Mode: When enabled, the script calculates the trade size based on the available "Free Margin" (the uninvested cash in your trading account). This allows the script to potentially increase the position size as your account balance grows, seeking to compound gains.
  • Fixed Lot Mode: Alternatively, it can be set to trade a consistent, predetermined volume regardless of the account balance.

Operational Flow

Every time the market updates, the script performs a continuous cycle:

  • It refreshes the latest market prices.
  • It checks if there is room to open new trades based on the price movement since the last update.
  • It scans all currently open positions to see if any have hit the profit or loss targets.
  • It executes the necessary closures or modifications instantly to keep the portfolio aligned with the strategy's goals.
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reachedIt Closes Orders by itself It can change open orders parameters, due to possible stepping strategy
12 Views
0 Downloads
0 Favorites
SLR_MoneyRain
//+------------------------------------------------------------------+
//|                                                    SHE_Lucky.mq4 |
//|                              Copyright © 2006, strategy.alfamoon |
//|                                     http://expertmillionaire.ru/ |
//+------------------------------------------------------------------+

double a, b; 
bool first=true; 
int Shift = 3;
double Lot=0.1;
int Limit = 11;//6;
int Take = 1;
int NumOrd=4;
bool Reinvest=true;
 
int z;
//---------------------------------------------------------------------------- 
int start(){ 
  RefreshRates();
  if (first) {a=Ask; b=Bid; first=false; return(0);} 
  z=MarketInfo(Symbol(),MODE_STOPLEVEL);
  if (OrdersTotal()<NumOrd)
  {
  if (Ask-a>=Shift*Point) 
    {OrderSend(Symbol(),OP_SELL,GetLots(),Bid,1,Bid+Limit*Point,0,"LC",0,0,Red);} 
  if (b-Bid>=Shift*Point) 
    {OrderSend(Symbol(),OP_BUY,GetLots(),Ask,1,Ask-Limit*Point,0,"LC",0,0,Blue);} 
   }
  a=Ask;  
  b=Bid; 
  ModifyAll();
  CloseAll(); 
return(0);} 
//----------------------------------------------------------------------------- 
void CloseAll() { 
  int j=OrdersTotal()-1;
  for (int cnt = j; cnt >= 0; cnt--) { 
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES); 
    RefreshRates();
    if (OrderSymbol() == Symbol()) { 
      if(OrderType()==OP_BUY && Bid-OrderOpenPrice()>=Take*Point)  OrderClose(OrderTicket(),OrderLots(),Bid,2,CLR_NONE); 
      if(OrderType()==OP_SELL && OrderOpenPrice()-Ask>Take*Point) OrderClose(OrderTicket(),OrderLots(),Ask,2,CLR_NONE); 
      if((OrderType()==OP_BUY)  && (((OrderOpenPrice()-Ask)/Point) > Limit)) OrderClose(OrderTicket(),OrderLots(),Bid,3,Green); 
      if((OrderType()==OP_SELL) && (((Bid-OrderOpenPrice())/Point) > Limit)) OrderClose(OrderTicket(),OrderLots(),Ask,3,Green); 
    } 
  } 
} 
//----------------------------------------------------------------------------- 
void ModifyAll() { 
  int j=OrdersTotal()-1;
/*  for (int cnt = j; cnt >= 0; cnt--) { 
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES); 
    if (OrderSymbol() == Symbol() && OrderTakeProfit()==0) { 
      { 
        if((OrderType()==OP_BUY)  && (((OrderOpenPrice()-Ask)/Point) >= z-Take)) 
          OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice()+Take*Point,0,Gold); 
        if((OrderType()==OP_SELL) && (((Bid-OrderOpenPrice())/Point) >= z-Take)) 
          OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice()-Take*Point,0,Gold); 
      } 
    } 
  } */
} 
//-------------------------------------------------------------------------- 
double GetLots() { 
  if(Reinvest) return (NormalizeDouble(AccountFreeMargin()/3000,1)); else return (Lot); 
} 
//------------------------------------------------------------------------- 


Profitability Reports

PERFORMANCE BY SYMBOL

Expected payoff

Average expected payoff across the available backtests for each symbol.

Positive Negative
4 reports
AUD/USD Oct 2024 - Jan 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
NZD/USD Oct 2024 - Jan 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
USD/CAD Oct 2024 - Jan 2025
0.00
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%

Comments