myRandom

ElectricSavant

Active Trader
Dec 8, 2010
41
1
27
Very insightful post...Thanks Tony.

ES

Hello there,
Thankyou, this is very interesting.
I have been trading Forex for about an year now, and I can say that most of the time the Market is random due to News events, natural disasters, wars etc...
But the market can only go in 3 directions:
1)Ranging
2)Up
3)Down
When it goes Up or Down, it doesn't go in a straight line, but only in Fibonacci retracements. This is the only pattern that I see in Forex.
So the fact that you use a random entry period, is a very good idea to work with the Fib tracements.

Anyhow, with the myRandom ea suing default settings., if it opens 5 trades a month, there is only 1/6 chances 16% of chance you can loose, and 84% of chance of making a profit- ranging from small profits to large profits.

Its all about probability.
There's so many Eas out there that try to trade according to some pattern and most of them don't even reach 90% success rate- and there is no gurantee that is will continue to work in future market conditions. This is worry- better to change something that is random, which will work in all market conditions.
Like throwing a dice, how many times will 6 come up?
or 1 come up?

Thanks alot :)
Tony
 

competent123

Trader
Feb 13, 2013
9
0
17
believe me or not, but i registered on this forum just to send an email to administrator. :)

i am trying to use myrandom EA by envid, and i want to add a trailing stoploss function to this EA.

i am trying it since many days but failed miserably.
i tried using a stoploss ea but then it does not
ECN mode changes stoploss up and down both ways.

i want it something like this


buy at 1.3000

stoploss at 1.2900

if price goes to 1.3050 then stoploss should move to 1.2950.

if price comes back to 1.3000 then stoploss should remain at 1.2950 and not go back to 1.2900 like it is doing now.

you have no idea how helpful it will be for me.

since you are an admin, you can see my email, so please email me if you are kind enough.

Regards
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,246
1,507
144
Odesa
www.earnforex.com
There are standard conditions to check to modify stop-loss with trailing stop. For buy:
MQL4:
if ((NewSL > OrderStopLoss()) || (OrderStopLoss() == 0))
// here goes OrderModify() with new SL
For sell:
MQL4:
if ((NewSL < OrderStopLoss()) || (OrderStopLoss() == 0))
// here goes OrderModify() with new SL
 
Last edited:

competent123

Trader
Feb 13, 2013
9
0
17
Thank you

Thank you very much, it worked,


it added a new problem btw. now stoploss moves the way it should , but take profit moves up and down as well , never actually hitting TP, a very bad situation for small scalper mode.


can you please tell me where to exactly put the relevant code? to never move tp.


( after which line and before which line.)
 

competent123

Trader
Feb 13, 2013
9
0
17
This code moves stoploss in the way it should, and i have experimenting with removing takeprofit completely.


MQL4:
extern double Lots = 0.1;
extern double Slippage = 3;
extern int RandomEntryPeriod = 80; //In bars. How many bars to wait before entering a new position.
extern int StopLoss = 90;
extern int TakeProfit = 600;
extern int MaxPositions = 4;
 
extern bool ECN_Mode = false; // In ECN mode, SL and TP aren't applied on OrderSend() but are added later with OrderModify()
 
extern color clOpenBuy = Blue;
extern color clOpenSell = Red;
 
int Magic;
int LastBars = 0;
int OrderTaken = 0;
 
double Poin;
int Deviation;
 
int init()
{
   //Checking for unconvetional Point digits number
   if ((Point == 0.00001) || (Point == 0.001))
   {
      Poin = Point * 10;
      Deviation = Slippage * 10;
   }
   else
   {
      Poin = Point; //Normal
      Deviation = Slippage;
   }
   Magic = Period()+1339005;
   return(0);
}
 
//+------------------------------------------------------------------+
//| Random entry expert advisor                                      |
//+------------------------------------------------------------------+
int start()
{
   if (ECN_Mode) DoSLTP();
 
    if (LastBars == Bars) return(0);
    else LastBars = Bars;
 
   if (AccountFreeMargin() < (Lots*2*1000)) return(0); 
 
   if (Lots < 0.1) return(0);
 
   MathSrand(TimeLocal());
 
   int count = 0;
   int total = OrdersTotal();
   for (int pos = 0; pos < total; pos++)
   {
     if (OrderSelect(pos, SELECT_BY_POS) == false) continue;
     if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol())) count++;
   }
 
   if (count >= MaxPositions) return(0);
 
   if (Bars >= OrderTaken + RandomEntryPeriod)
   {
      if ((MathRand()%2) == 1)
      {
          fSell();
      }
      else
      {
          fBuy();
      }
      OrderTaken = Bars;
   }
}
 
//+------------------------------------------------------------------+
//| Buy                                                              |
//+------------------------------------------------------------------+
void fBuy()
{
    double SL = 0, TP = 0;
    RefreshRates();
    if (!ECN_Mode) 
    {
      if (StopLoss > 0) SL = Ask - StopLoss * Poin;
      if (TakeProfit > 0) TP = Ask + TakeProfit * Poin;
   }
    int result = OrderSend(Symbol(), OP_BUY, Lots, Ask, Deviation, SL, TP, "myRandom", Magic, 0, clOpenBuy); 
    if (result == -1)
    {
        int e = GetLastError();
        Print("OrderSend Error: ", e);
    }
}
 
//+------------------------------------------------------------------+
//| Sell                                                             |
//+------------------------------------------------------------------+
void fSell()
{
    double SL = 0, TP = 0;
    RefreshRates();
    if (!ECN_Mode) 
    {
       if (StopLoss > 0) SL = Bid + StopLoss * Poin;
       if (TakeProfit > 0) TP = Bid - TakeProfit * Poin;
   }
    int result = OrderSend(Symbol(), OP_SELL, Lots, Bid, Deviation, SL, TP, "myRandom", Magic, 0, clOpenSell); 
    if (result == -1)
    {
        int e = GetLastError();
        Print("OrderSend Error: ", e);
    }
}
 
//+------------------------------------------------------------------+
//| Applies SL and TP to open positions if ECN mode is on.           |
//+------------------------------------------------------------------+
void DoSLTP()
{
   double SL = 0, TP = 0;
   for (int i = 0; i < OrdersTotal(); i++) 
   {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol())) 
      {
          RefreshRates();
         if (OrderType() == OP_BUY)
         {
            if (StopLoss > 0) SL = NormalizeDouble(Ask - StopLoss * Poin, Digits);
            if (TakeProfit > 0) TP = NormalizeDouble(Ask + TakeProfit * Poin, Digits);
            if ((OrderStopLoss() != SL) || (OrderTakeProfit() != TP))
            if ((SL > OrderStopLoss()) || (OrderStopLoss() == 0))
            {
               OrderModify(OrderTicket(), OrderOpenPrice(), SL, 0, 0);
            }
         }
         else if (OrderType() == OP_SELL)
         {
            if (StopLoss > 0) SL = NormalizeDouble(Bid + StopLoss * Poin, Digits);
            if (TakeProfit > 0) TP = NormalizeDouble(Bid - TakeProfit * Poin, Digits);
            if ((OrderStopLoss() != SL) || (OrderTakeProfit() != TP))
            if ((SL < OrderStopLoss()) || (OrderStopLoss() == 0))
            {
               OrderModify(OrderTicket(), OrderOpenPrice(), SL, 0, 0);
            }
         }
      }
    }
}
--------------------


the problem is in this following code, it moves take profit up and down as well, thereby making it useless for scalpers. i want it to work like this -

random trade , take profit 20, stoploss 20
if trade open at 1.3000 stoploss is at 1.2980 and takeprofit at 1.3020.

if market moves to 1.3010, stoploss moves to 1.2990 but stoploss remains at 1.3020

if market moves drops to 1.2995, stoploss stays at 1.2990, take profit remains at 1.3020

Thank you so very much ENVID { you definitely are a lifesaver}

can there be a much better function to move stoploss/takeprofit, if NOT in ECN mode, as i dont' see a function to modify order if not in ecn mode.

i have 0 knowledge of programming.

MQL4:
extern double Lots = 0.1;
extern double Slippage = 3;
extern int RandomEntryPeriod = 80; //In bars. How many bars to wait before entering a new position.
extern int StopLoss = 90;
extern int TakeProfit = 600;
extern int MaxPositions = 4;
 
extern bool ECN_Mode = false; // In ECN mode, SL and TP aren't applied on OrderSend() but are added later with OrderModify()
 
extern color clOpenBuy = Blue;
extern color clOpenSell = Red;
 
int Magic;
int LastBars = 0;
int OrderTaken = 0;
 
double Poin;
int Deviation;
 
int init()
{
   //Checking for unconvetional Point digits number
   if ((Point == 0.00001) || (Point == 0.001))
   {
      Poin = Point * 10;
      Deviation = Slippage * 10;
   }
   else
   {
      Poin = Point; //Normal
      Deviation = Slippage;
   }
   Magic = Period()+1339005;
   return(0);
}
 
//+------------------------------------------------------------------+
//| Random entry expert advisor                                      |
//+------------------------------------------------------------------+
int start()
{
   if (ECN_Mode) DoSLTP();
 
    if (LastBars == Bars) return(0);
    else LastBars = Bars;
 
   if (AccountFreeMargin() < (Lots*2*1000)) return(0); 
 
   if (Lots < 0.1) return(0);
 
   MathSrand(TimeLocal());
 
   int count = 0;
   int total = OrdersTotal();
   for (int pos = 0; pos < total; pos++)
   {
     if (OrderSelect(pos, SELECT_BY_POS) == false) continue;
     if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol())) count++;
   }
 
   if (count >= MaxPositions) return(0);
 
   if (Bars >= OrderTaken + RandomEntryPeriod)
   {
      if ((MathRand()%2) == 1)
      {
          fSell();
      }
      else
      {
          fBuy();
      }
      OrderTaken = Bars;
   }
}
 
//+------------------------------------------------------------------+
//| Buy                                                              |
//+------------------------------------------------------------------+
void fBuy()
{
    double SL = 0, TP = 0;
    RefreshRates();
    if (!ECN_Mode) 
    {
      if (StopLoss > 0) SL = Ask - StopLoss * Poin;
      if (TakeProfit > 0) TP = Ask + TakeProfit * Poin;
   }
    int result = OrderSend(Symbol(), OP_BUY, Lots, Ask, Deviation, SL, TP, "myRandom", Magic, 0, clOpenBuy); 
    if (result == -1)
    {
        int e = GetLastError();
        Print("OrderSend Error: ", e);
    }
}
 
//+------------------------------------------------------------------+
//| Sell                                                             |
//+------------------------------------------------------------------+
void fSell()
{
    double SL = 0, TP = 0;
    RefreshRates();
    if (!ECN_Mode) 
    {
       if (StopLoss > 0) SL = Bid + StopLoss * Poin;
       if (TakeProfit > 0) TP = Bid - TakeProfit * Poin;
   }
    int result = OrderSend(Symbol(), OP_SELL, Lots, Bid, Deviation, SL, TP, "myRandom", Magic, 0, clOpenSell); 
    if (result == -1)
    {
        int e = GetLastError();
        Print("OrderSend Error: ", e);
    }
}
 
//+------------------------------------------------------------------+
//| Applies SL and TP to open positions if ECN mode is on.           |
//+------------------------------------------------------------------+
void DoSLTP()
{
   double SL = 0, TP = 0;
   for (int i = 0; i < OrdersTotal(); i++) 
   {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol())) 
      {
          RefreshRates();
         if (OrderType() == OP_BUY)
         {
            if (StopLoss > 0) SL = NormalizeDouble(Ask - StopLoss * Poin, Digits);
            if (TakeProfit > 0) TP = NormalizeDouble(Ask + TakeProfit * Poin, Digits);
            if ((OrderStopLoss() != SL) || (OrderTakeProfit() != TP))
            if ((SL > OrderStopLoss()) || (OrderStopLoss() == 0))
 
 
            {
               OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0);
            }
         }
         else if (OrderType() == OP_SELL)
         {
            if (StopLoss > 0) SL = NormalizeDouble(Bid + StopLoss * Poin, Digits);
            if (TakeProfit > 0) TP = NormalizeDouble(Bid - TakeProfit * Poin, Digits);
            if ((OrderStopLoss() != SL) || (OrderTakeProfit() != TP))
            if ((SL < OrderStopLoss()) || (OrderStopLoss() == 0))
               {
               OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0);
            }
         }
      }
    }
}
 
Last edited by a moderator:

Enivid

Administrator
Staff member
Nov 30, 2008
19,246
1,507
144
Odesa
www.earnforex.com
First, please use the MQL highlighting when posting code. Or better attach the .mq4 files when you want to show the whole EA.

Second, do not do anything with DoSLTP() function or ECN_Mode - their only purpose is to provide ECN compatibility. They cannot be used for trailing stop.

Third, you can copy trailing stop functionality from my Adjustable MA expert advisor. There is DoTrailing() function that should be called from start(). You can look at how it is done there and do the same in myRandom.
 

competent123

Trader
Feb 13, 2013
9
0
17
MQL4:
extern double Lots = 0.1;
extern double Slippage = 3;
extern int RandomEntryPeriod = 80; //In bars. How many bars to wait before entering a new position.
extern int StopLoss = 90;
extern int TakeProfit = 600;
extern int MaxPositions = 4;
extern int TrailingStop = 20;
 
extern bool ECN_Mode = false; // In ECN mode, SL and TP aren't applied on OrderSend() but are added later with OrderModify()
 
extern color clOpenBuy = Blue;
extern color clOpenSell = Red;
 
int Magic;
int LastBars = 0;
int OrderTaken = 0;
 
double Poin;
int Deviation;
 
int init()
{
   //Checking for unconvetional Point digits number
   if ((Point == 0.00001) || (Point == 0.001))
   {
      Poin = Point * 10;
      Deviation = Slippage * 10;
   }
   else
   {
      Poin = Point; //Normal
      Deviation = Slippage;
   }
   Magic = Period()+1339005;
   return(0);
}
 
//+------------------------------------------------------------------+
//| Random entry expert advisor                                      |
//+------------------------------------------------------------------+
int start()
{
 
   if (ECN_Mode) 
   {
    DoTrailing();
   DoSLTP();
 
}
    if (LastBars == Bars) return(0);
    else LastBars = Bars;
 
   if (AccountFreeMargin() < (Lots*2*1000)) return(0);
 
   if (Lots < 0.1) return(0);
 
   MathSrand(TimeLocal());
 
   int count = 0;
   int total = OrdersTotal();
   for (int pos = 0; pos < total; pos++)
   {
     if (OrderSelect(pos, SELECT_BY_POS) == false) continue;
     if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol())) count++;
   }
 
   if (count >= MaxPositions) return(0);
 
   if (Bars >= OrderTaken + RandomEntryPeriod)
   {
      if ((MathRand()%2) == 1)
      {
          fSell();
      }
      else
      {
          fBuy();
      }
      OrderTaken = Bars;
   }
}
 
//+------------------------------------------------------------------+
//| Buy                                                              |
//+------------------------------------------------------------------+
void fBuy()
{
    double SL = 0, TP = 0;
    RefreshRates();
    if (!ECN_Mode)
    {
      if (StopLoss > 0) SL = Ask - StopLoss * Poin;
      if (TakeProfit > 0) TP = Ask + TakeProfit * Poin;
   }
    int result = OrderSend(Symbol(), OP_BUY, Lots, Ask, Deviation, SL, TP, "myRandom", Magic, 0, clOpenBuy);
    if (result == -1)
    {
        int e = GetLastError();
        Print("OrderSend Error: ", e);
    }
}
 
//+------------------------------------------------------------------+
//| Sell                                                             |
//+------------------------------------------------------------------+
void fSell()
{
    double SL = 0, TP = 0;
    RefreshRates();
    if (!ECN_Mode)
    {
       if (StopLoss > 0) SL = Bid + StopLoss * Poin;
       if (TakeProfit > 0) TP = Bid - TakeProfit * Poin;
   }
    int result = OrderSend(Symbol(), OP_SELL, Lots, Bid, Deviation, SL, TP, "myRandom", Magic, 0, clOpenSell);
    if (result == -1)
    {
        int e = GetLastError();
        Print("OrderSend Error: ", e);
    }
}
 
//+------------------------------------------------------------------+
//| Applies SL and TP to open positions if ECN mode is on.           |
//+------------------------------------------------------------------+
void DoSLTP()
{
   double SL = 0, TP = 0;
   for (int i = 0; i < OrdersTotal(); i++)
   {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol()))
      {
          RefreshRates();
         if (OrderType() == OP_BUY)
         {
            if (StopLoss > 0) SL = NormalizeDouble(Ask - StopLoss * Poin, Digits);
            if (TakeProfit > 0) TP = NormalizeDouble(Ask + TakeProfit * Poin, Digits);
            if ((OrderStopLoss() != SL) || (OrderTakeProfit() != TP))
            if ((SL > OrderStopLoss()) || (OrderStopLoss() == 0))
 
 
            {
               OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0);
            }
         }
         else if (OrderType() == OP_SELL)
         {
            if (StopLoss > 0) SL = NormalizeDouble(Bid + StopLoss * Poin, Digits);
            if (TakeProfit > 0) TP = NormalizeDouble(Bid - TakeProfit * Poin, Digits);
            if ((OrderStopLoss() != SL) || (OrderTakeProfit() != TP))
            if ((SL < OrderStopLoss()) || (OrderStopLoss() == 0))
               {
               OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0);
            }
         }
      }
    }
}
void DoTrailing()
{
   int total = OrdersTotal();
   for (int pos = 0; pos < total; pos++)
   {
      if (OrderSelect(pos, SELECT_BY_POS) == false) continue;
      if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol()))
      {
         if (OrderType() == OP_BUY)
         {
            RefreshRates();
            if (Bid - OrderOpenPrice() >= TrailingStop * Poin) //If profit is greater or equal to the desired Trailing Stop value
            {
               if (OrderStopLoss() < (Bid - TrailingStop * Poin)) //If the current stop-loss is below the desired trailing stop level
                  OrderModify(OrderTicket(), OrderOpenPrice(), Bid - TrailingStop * Poin, OrderTakeProfit(), 0);
            }
         }
         else if (OrderType() == OP_SELL)
         {
            RefreshRates();
            if (OrderOpenPrice() - Ask >= TrailingStop * Poin) //If profit is greater or equal to the desired Trailing Stop value
            {
	              if ((OrderStopLoss() > (Ask + TrailingStop * Poin)) || (OrderStopLoss() == 0)) //If the current stop-loss is below the desired trailing stop level
                  OrderModify(OrderTicket(), OrderOpenPrice(), Ask + TrailingStop * Poin, OrderTakeProfit(), 0);
            }
         }
      }
   }   
}

i am so sorry for posting again, i have spun my head for many days now, with 0 success.!

i tried as you said, with that other EA you referred to. it didnt work ( i mentioned i am NOT a programmer, a copy paster, at best)

in this code BOTH stop loss and take profit move.
it gives no error with mt editor.
if you would be kind enough to modify it so that tp does not move, only sl moves.
i am using MRCmarkets.com broker , it gives order 130 error if i don't use ecn mode.
Thank you so much in advance.
 
Last edited by a moderator:

Enivid

Administrator
Staff member
Nov 30, 2008
19,246
1,507
144
Odesa
www.earnforex.com
Substitute DoSLTP() implementation with this fixed version:

MQL4:
void DoSLTP()
{
   double SL = 0, TP = 0;
   for (int i = 0; i < OrdersTotal(); i++) 
   {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if ((OrderMagicNumber() == Magic) && (OrderSymbol() == Symbol())) 
      {
         if (OrderType() == OP_BUY)
         {
            if (StopLoss > 0) SL = NormalizeDouble(OrderOpenPrice() - StopLoss * Poin, Digits);
            if (TakeProfit > 0) TP = NormalizeDouble(OrderOpenPrice() + TakeProfit * Poin, Digits);
            if (((OrderStopLoss() != SL) || (OrderTakeProfit() != TP)) && (OrderStopLoss() == 0) && (OrderTakeProfit() == 0))
            {
               OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0);
            }
         }
         else if (OrderType() == OP_SELL)
         {
            if (StopLoss > 0) SL = NormalizeDouble(OrderOpenPrice() + StopLoss * Poin, Digits);
            if (TakeProfit > 0) TP = NormalizeDouble(OrderOpenPrice() - TakeProfit * Poin, Digits);
            if (((OrderStopLoss() != SL) || (OrderTakeProfit() != TP)) && (OrderStopLoss() == 0) && (OrderTakeProfit() == 0))
            {
               OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0);
            }
         }
      }
	}
}

Leave everything else as is. Should work fine. Please let me know if it doesn't.
 
Last edited:

competent123

Trader
Feb 13, 2013
9
0
17
i have tried this code, but now both don't move.

i want something like this - ea buys something, it should not move take profit, but only trailing stoploss should move the way it should.( it should not lower the stoploss)

i think you forgot to put < or > somewhere.

Please take a look. and thank you so much for replying.
 

competent123

Trader
Feb 13, 2013
9
0
17
i am using the settings which are inside the file itself.

i mt4 isn't even sending command to change stoploss/takeprofit ( it should have shown (error order send 130) if stoploss/tp is too close.

as already indicated, i am expecting this behaviour from ea -

opens trade randomly.

if trade is goes in profit, tp does not move, only sl moves 20 pips behind current price ( or the figure user decides)

if it goes in loss, nothing moves, it simply hits the stoploss, and then opens other random trade after the number of bars set in settings.


Regards
 

Attachments

  • myRandom.mq4
    4.5 KB · Views: 27

competent123

Trader
Feb 13, 2013
9
0
17
i think you forgot to attach the ea itself.

because at least i can't see it attached anywhere.

and i tried modifications as you mentioned ( dont' remove DoTrailing() ) from ea. it didnt' work.
 

competent123

Trader
Feb 13, 2013
9
0
17
Thank you for your time.

it works a bit differently.

i think its my fault that i gave you the wrong idea of what i am trying to get the ea to do.

i intent to use this EA for SCALPING purposes.

i need it to work like this

if trade moves 1 pip in profit, stoploss should move i pip up, ( reducing my risk by 1 pip)

if trade moves 1 pip in loss, nothing changes, ( stoploss remains where it is, even after trade has been in profit.)

what this modified EA is doing is - when trade goes x amount in profit, ( equal to value in trailing stop) then trailing stoploss activates.

so if i buy at 1.3000 stoploss is at 1.2900 and take profit is 1.3100 and trailing stoploss is at 50.

trailing stoploss will be activated only when trade reaches 1.3050 and not 1.3001 as i intent, if market goes to 1.3049 and moves back to 1.2900 then i have a notional loss of 150 pips, which i could have avoided if my trailing stoploss would have been activated at 1.3001.

then my trailing stoploss would have been at 1.2999 ( 50 pip trailing stoploss) giving me loss of just 1 pip.

i think you understand what i mean. ( sorry for not being able to make it clear enough earlier)

Thank you.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,246
1,507
144
Odesa
www.earnforex.com
I see.

Find and replace this:
MQL4:
if (Bid - OrderOpenPrice() >= TrailingStop * Poin) //If profit is greater or equal to the desired Trailing Stop value

with this:

MQL4:
if (Bid >= OrderOpenPrice())

And replace this:
MQL4:
if (OrderOpenPrice() - Ask >= TrailingStop * Poin) //If profit is greater or equal to the desired Trailing Stop value

with this:

MQL4:
if (OrderOpenPrice() <= Ask)
 
Last edited:

competent123

Trader
Feb 13, 2013
9
0
17
Thanks, it worked the way i wanted, but it didn't make money the way i wanted. :(

so for a change, can a small change be made in no take profit version of it.

i.e. if a stoploss occurs, only then the reverse trade is opened, otherwise its random trade.


for ex - if ea opens buy trade at 1.2000 with a stoploss of 50 pips, then when the price goes to 1.1950 , stoploss hits, but the ea opens a sell trade at 1.1950 so if it goes below, it will automatically, start to make profit ( it will at least reduce some loss.)

also, if i close the trade myself, at any point, it should open the trade RANDOMLY.


Thanks.
 

jcn

Trader
Aug 26, 2013
1
0
12
Hi Enivid. Interesting EA!! it's extremely hard to beat this EA - i've tried. I really appreciate it.. Av. Win / Av. Loss, Profit:MaxDrawdown ratio etcetc so hard to beat...Adding trailing stops will not (i doubt) improve the EA - we need that reward:risk 600:90 and room for volatility. I mean, this EA changes the way I think about trading... Your idea is very unique.. Random time entry! Never seen anything like that on any books i've read so far.. (Or maybe I'm a slow learner) Thanks again..! And your coding is soo clean and simple, unlike others out there!!! btw, this EA is so good (in my opinion) that I've decided to leave you a message to say thank you. for the first time (i don't leave messages to any forum, actually never ever). This is worth it.. :) Thanks. I think i've made my point enough..