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.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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