Badorders_v1

Author: Copyright � 2005, MetaQuotes Software Corp.
Profit factor:
20.71

This script, designed for the MetaTrader platform, aims to automatically manage and place trading orders.

Here's a breakdown of what it does, in plain language:

  • Initialization: When the script starts running, it doesn't perform any specific setup actions.

  • Order Management: It tries to close all previously opened positions in the market and then will attempt to place two buy-stop orders in the market.

    • The script closes the order identified by its 'ticket' number, and then try to send one buy-stop.
    • Then it will try to modify this buy stop order to change the entry level of the pending order.
  • Deinitialization: When the script is stopped or removed from the chart, it doesn't perform any specific cleanup actions.

Orders Execution
It Closes Orders by itself It automatically opens orders when conditions are reachedIt can change open orders parameters, due to possible stepping strategy
9 Views
2 Downloads
0 Favorites
Badorders_v1
//+------------------------------------------------------------------+
//|                                                    BadOrders.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
//----
double asdf;
double ticket, t2;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//---- 
   //This section closes any positions opened on the last tick
   OrderSelect(1,SELECT_BY_POS);
   OrderClose(OrderTicket(),1,Bid,8,Red);
   ticket=OrderSend(Symbol(),OP_BUYSTOP,1,Bid+100*Point,3,0,0,"asdfasdf",16384,0,Green);
   t2=OrderSelect(ticket,SELECT_BY_TICKET);
   OrderModify(OrderTicket(),Bid-100*Point,0,0,0,Green);
   //OrderClose(OrderTicket(),1,Bid,8,Red);
   //OrderSend(Symbol(),OP_BUYSTOP,1,Bid-100*Point,3,0,0,"asdfasdf",16384,0,Green);
//----
   return(0);
  }
//+------------------------------------------------------------------+

Profitability Reports

USD/CAD Oct 2024 - Jan 2025
0.01
Total Trades 39
Won Trades 1
Lost trades 38
Win Rate 2.56 %
Expected payoff -6.53
Gross Profit 2.22
Gross Loss -257.05
Total Net Profit -254.83
-100%
-50%
0%
50%
100%
GBP/USD Oct 2024 - Jan 2025
41.42
Total Trades 28
Won Trades 0
Lost trades 0
Win Rate 0.00 %
Expected payoff 17.32
Gross Profit 497.00
Gross Loss -12.00
Total Net Profit 485.00
-100%
-50%
0%
50%
100%

Comments