iForce

 

Hello,

I´m experimenting with the iForce indicator. And now I want that mt4 give a signal(arrow) as soon as the iForce indicator reach a defined value. May be 0.2.
I tried it with this way.

if(iForce(NULL,0,1,0,PRICE_HIGH,1) >= 0.2){

         string FR="ArrBuy "+TimeToStr(CurTime());
            ObjectCreate(FR,OBJ_ARROW_UP,0,Time[0],WindowPriceOnDropped(),0,0,0,0);
            ObjectSet(FR, OBJPROP_ARROWCODE, 233);
            ObjectSet(FR, OBJPROP_COLOR , Yellow);
         }

But with this way he make the arrow when the bar is ready and a new bar is performing. I want to have the arrow in the moment when the value is higher than 0.2.

How do I has to handle this?


Thank you
 
Frika:

Hello,

I´m experimenting with the iForce indicator. And now I want that mt4 give a signal(arrow) as soon as the iForce indicator reach a defined value. May be 0.2.
I tried it with this way.

if(iForce(NULL,0,1,0,PRICE_HIGH,1) >= 0.2){

         string FR="ArrBuy "+TimeToStr(CurTime());
            ObjectCreate(FR,OBJ_ARROW_UP,0,Time[0],WindowPriceOnDropped(),0,0,0,0);
            ObjectSet(FR, OBJPROP_ARROWCODE, 233);
            ObjectSet(FR, OBJPROP_COLOR , Yellow);
         }

But with this way he make the arrow when the bar is ready and a new bar is performing. I want to have the arrow in the moment when the value is higher than 0.2.

you are looking at the last bar, not current bar.