How to code an [Invisible Stop Loss] Why it's necessary to confuse broker monitoring

Some will monitor your EA. They place you on a monitoring list after confirming that your EA is profitable. Then they monitor the EA’s trading strategy, predictability and stop-levels. If your EA is predictable, they’ll look for ways to manipulate price. for this reason, I inform coders to only utilize take-profit levels, but not use stop-loss levels.

Instead, of using a stop-loss, code in when to close the market order whenever price declines in its opposite direction by a specified amount of points. [This effectively is a hidden stop loss].

Example: If price > 20 points below your buy market order, select the order and close it. (This creates an invisible stop-loss and perplexes the broker, making it difficult for them to predict the nature of your EA).

At the end of the day, a forex-broker earns money in 3 ways: 1. Commissions, 2. Spread fee and 3. Every-loss trade. Therefore, they profit when you lose, and would prefer to not pay you if you win.
How much money do they make per day?
If a broker has 5 million active traders on its server losing trades in addition to applying aforesaid fees, the math of this equation approximates to: (1=Day of trading + (5 million * $0.50 spread) + ($1 commission * 5 million) + ($50 trades loss * 5 million) = $257,500,000. PER DAY! (Not including the profits generated by the losses of financial institutions). :moneybag: Therefore, they can easily afford to pay your profitable EA.

[Now for Beginner Coders who’d ask me:]

Ok, “30-Dimensions”, How do you code an invisible stop-loss? Ans. Like this:

(The beauty of coding mql4, is there are multiple routes to achieve one goal.) For example purposes: The code below is structured to close the order after 20 pips negative to entry price. If the the current market price reaches 20 pips opposite of your sell, the order will be closed. (Though this code will compile in mql4, it’s only for example purposes. If you wish to use it for your EA, you should definitely swap out the “If” statement with one that suits your trade conditions.)

int     market_order_sell_type  = OP_SELL;

int  sell_market_total       = OrdersTotal();
if(  sell_market_total <1){
bool refresh_the_rates       = RefreshRates();

Print("RefreshRates return=:"," ", refresh_the_rates);
int  market_order_sell_send  = OrderSend(_Symbol,market_order_sell_type,lot_size_volume,Bid,set_slippage,0,0,NULL,magic_mumber,0,clrNONE);
}
bool    select_market_order  = OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
int     get_magic_number     = OrderMagicNumber();
double  get_order_open_price = OrderOpenPrice();
int     get_order_ticket     = OrderTicket();

Print("OrderSelect           return=:     "," ",   select_market_order
," ", "OrderMagicNumber      return=:     "," ",   get_magic_number
," ", "OrderOpenPrice        return=:     "," ",   get_order_open_price
," ", "OrderTicket           return=:     "," ",   get_order_ticket);

     if(select_market_order    == true &&          get_magic_number == 222333){
double  set_invisible_stoploss =                   get_order_open_price + 200*_Point;
Comment("Invisible stop=:                 "," ",   set_invisible_stoploss
," ",   "OrderOpenPrice=:                 "," ",   get_order_open_price
," ",   "Ask=:",RefreshRates(),Ask);
}     
     if(Ask >  get_order_open_price + 200*_Point){
     bool      close_market_order = OrderClose(get_order_ticket,lot_size_volume,Ask,set_slippage,clrNONE);
     int       get_order_error    = GetLastError();Print(get_order_error);
     }

Color coordination :trophy: