Help with setting stop loss please...

 
int Open_Position()
{
   double mystop = Ask-Stop*Point;
 
   
   for (int pos = 1; Low[pos] > Low[pos+1]; pos++)
   {
      mystop = Low[pos+1] * (Low[pos+1] < mystop);
   }
   
   if (mystop > Ask-Stop*Point)
   {
      mystop = Ask-Stop*Point;
   }
   
   OrderSend(Symbol(),OP_BUY,1,Ask,3,mystop,0,"EA Order",MagicNumber,0,Green);
   return (0);
}
This is currently the code I am using to open my orders. Basically what I am going for is a stop loss of 15 pips(Stop is declared as: extern int Stop = 15;) unless the previous bottom is lower than 15 pips. I obviously have some sort of error with my logic here because Only some of my orders have an S/L. Hopefully a fresh set of eyes can shed some light on my dilemma. Thanks for any help/suggestions.
 

mystop = Low[pos+1] * (Low[pos+1] < mystop);

That line doesn't compute.

 
int Open_Position()
{
   double mystop;

   
   for (int pos = 1; Low[pos] > Low[pos+1]; pos++)
   {
      if(Low[pos+1]<(Ask-Stop*Point))
       mystop = Low[pos+1];//or what ever you want the new stop to be
      else mystop = Ask-Stop*Point;
   }
   
   OrderSend(Symbol(),OP_BUY,1,Ask,3,mystop,0,"EA Order",MagicNumber,0,Green);
   return (0);
}
I am a little confused on your logic but I think that this is what you are going for.
 
Oh... I thought (Low[pos+1] < mystop) would evaluate to a 1 or 0... Thanks...
 

Hmm.. Ok, maybe it does...

Find out....


{
Print(" (Low[pos+1] < mystop) evaluates to ", (Low[pos+1] < mystop););

mystop = Low[pos+1] * (Low[pos+1] < mystop);
}

 

Hi,

Unfortunately I can't help you fix yours but I found a great little very reasonably priced and flexible and effective commercial utility that has a 2 stage Trailing Stop Loss (TSL) that you can use either on its own or in conjunction with other AEs (it overrides the TSL in other AEs). It is from PipBoxer.Com: look for PBTS. Like all TSL, you have to have a profit that is equal to or greater than the amount of your TSL before it kicks in. Being a commercial product it is only available in compiled format of course.

Good luck with it.

…………………(8 >) Prosperous Trading (< 8)

DougRH4x

.

PS: I’m looking for someone to splice an adjustable (Trailing &) Stop Loss into the Martingale based program: PipMaker. Overcoming this one downfall of this program will make it VERY profitable!

 
DougRH4x wrote >>

Hi,

Unfortunately I can't help you fix yours but I found a great little very reasonably priced and flexible and effective commercial utility that has a 2 stage Trailing Stop Loss (TSL) that you can use either on its own or in conjunction with other AEs (it overrides the TSL in other AEs). It is from PipBoxer.Com: look for PBTS. Like all TSL, you have to have a profit that is equal to or greater than the amount of your TSL before it kicks in. Being a commercial product it is only available in compiled format of course.

Good luck with it.

…………………(8 >) Prosperous Trading (< 8)

DougRH4x

.

PS: I’m looking for someone to splice an adjustable (Trailing &) Stop Loss into the Martingale based program: PipMaker. Overcoming this one downfall of this program will make it VERY profitable!

Reason: