Please help me getting this to work

 

im trying to do and expression that will get the current ask price and then wait till it gets to an higer ask level

im doing it now but the while expression stuck the MT4

i know it should be simple but sometimes simple stuff gets complicated

i will appreciate if anyone will be able to help me

 

You need to store the ask price between ticks, you cant stall MT with a <wait while> as you have found out

extern int Gap.To.Order.Pips = 30; // 300 if sub-pip

static double sdTargetPrice;

init ()
{
   sdTargetPrice=0;
}

start()

{
   if (sdTargetPrice==0) sdTargetPrice = Ask+Gap.To.Order.Pips*Point

   if (Ask > sdTargetPrice)
     {
       // Sell.....
      
       sdTargetPrice = 0;
     }

}

FWIW

-BB-

 

but if for example

im now on a ask price

and i want to enter a function only when the new ask is bigger then the old one?

 

> function only when the new ask is bigger then the old one

What is the old price?

Price at the end of the last bar?

Price n minutes ago?

Some indicator?

?BB?

 

no its the ask on the current that is the ilowest of the las 5 min

 

valL=Low[iLowest(Symbol(),PERIOD_M1, PRICE_LOW,CandleCount, 1)];

if(valL>Ask)


thani want to wait till the ask will be bigger than the low

 

can you help me with that?

 
please help!