//|                 TwoPerBar                                        |
//|                 Copyright © 1999-2007, MetaQuotes Software Corp. |
//|                 http://www.metaquotes.ru                         |
#property copyright "Ron Thompson"
#property link      "http://www.lightpatch.com/forex"
//---- user input
extern double Lots=0.1;               // how many lots to trade at a time 
       int    Slippage=5;             // how many pips of slippage can you tolorate
extern double ProfitMade=19;          // how much money do you expect to make
extern double LotLimit=12.8;
//---- naming and numbering
int      MagicNumber =200605242205;   // allows multiple experts to trade on same account
string   TradeComment="TPB_00_";      // comment so multiple EAs can be seen in Account History
//---- Bar handling
datetime bartime=0;                   // used to determine when a bar has moved
int      bartick=0;                   // number of times bars have moved
//---- Trade control
bool TradeAllowed=true;               // used to manage trades
double mylotsi;                       // used to manage lots
int sotn;                             // sell order ticket number
int botn;                             // buy order ticket number
//|                                                                  |
int init()
// Called EACH TICK and each Bar[]
//|                                                                  |
int start()
   int      cnt=0;
   bool     ort;
   // bar counting
      // close everything
         if(OrderSelect(botn, SELECT_BY_TICKET)) OrderClose(botn,mylotsi,Bid,Slippage,White);
         if(OrderSelect(sotn, SELECT_BY_TICKET)) OrderClose(sotn,mylotsi,Ask,Slippage,Red);
        } //while
      // adjust lot size based on loss, with hard upper limit
      if(ort) {mylotsi=mylotsi*2.0;} else {mylotsi=Lots;}
      if(mylotsi>LotLimit) mylotsi=LotLimit;
      // place orders
      botn=OrderSend(Symbol(),OP_BUY, mylotsi,Ask,Slippage,0,0,TradeComment,MagicNumber,White);
   OrderSelect(botn, SELECT_BY_TICKET);
   OrderSelect(sotn, SELECT_BY_TICKET);
  } // start()



Market Information Used:

Series array that contains open time of each bar

Indicator Curves created:

Indicators Used:

Custom Indicators Used:

Order Management characteristics:
Checks for the total of open orders
It Closes Orders by itself

It automatically opens orders when conditions are reached

Other Features:

BackTest : USDCHF on H1

From 2009-12-01 to 2010-01-01 Profit Factor:0.44 Total Net Profit:-9992.35

BackTest : EURUSD on H1

From 2009-12-01 to 2010-01-17 Profit Factor:0.47 Total Net Profit:-10001.45

BackTest : USDCAD on H1

From 2009-12-01 to 2010-01-01 Profit Factor:0.16 Total Net Profit:-11072.25

BackTest : EURUSD on H1

From 2009-08-01 to 2009-10-01 Profit Factor:0.56 Total Net Profit:-9906.90

BackTest : GBPUSD on H1

From 2010-01-01 to 2010-02-27 Profit Factor:1.68 Total Net Profit:5976.28

BackTest : USDCAD on H1

From 2009-01-01 to 2010-01-01 Profit Factor:0.97 Total Net Profit:-4731.20

BackTest : EURUSD on H1

From 2010-03-01 to 2010-03-27 Profit Factor:1.81 Total Net Profit:2685.76

BackTest : EURUSD on H1

From 2010-04-01 to 2010-04-30 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-05-01 to 2010-05-31 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-06-01 to 2010-06-30 Profit Factor:0.00 Total Net Profit:0.00

Request Backtest for [ea]twoperbar_ron_mt4_vtest01_v1

From : (yyyy/mm/dd) To: (yyyy/mm/dd)

Pair: Period: