I have an indicator that gives a signal (arrow) if a set of conditions is met, however I have not been able to find the documentation for a BAR ON CLOSE option. Any thoughts/ideas on how to accomplish this. My dream will be to have the Input in that way I can choose weather I would like the BarOnClose or not, By the way I also would like that input for alarms. Any code ideas for any of these or where can I go for further reference.
Help will be greatly appreciated.
Without any code we will not be able to help you!
We cannot read your mind nor do we know what kind of indicator you are talking about or how it even works.
Without more information, we will simply be guessing!
No, it is not enough!
If you want help, don't be so secretive about it! If you don't open up and explain things, we cannot help.
PS! Something tells me you are a NinjaTrader programmer and you are looking for the equivalent to the "OnBarClose" event. Is that it? If so, MQL4 works differently, and you will have to explain exactly what you expect in order to find the best MQL4 approach for your requirements.
Yes I am a Ninja Trader, and yes I am looking for the OnBarClose equivalent. Thank you so much for your help.
MetaTrader's MQL4 language works differently to NinjaTrader and does not have OnBarClose. You have to learn to do things the MQL way.
I am not a NinjaTrader user and know nothing about its programming language. I simply used Google in order to try decipher what you may have wanted. However, it is not my responsibility to try guess what you want! You have to describe what it is that you are trying to achieve with your indicator, so that we can help you.
From what I can guess; you don't want the last and current bar to keep "repainting" because its current close price is constantly changing and therefore your alert keeps changing. However, that is how it is supposed to be in MetaTrader. The last bar is always in "flux". The equivalent of the "OnBarClose", is in MetaTrader, the equivalent to looking at the previous bar's data (i.e. the one just before the current one).
So instead of looking at the current bar (BUY or SELL) as a trigger for your Alert message, look at the previous bar (BUY or SELL). So, in essence if I understand your code correctly, in the "notifyAlert()" function, instead of the line "if( barNum != 0 ) return;" use:
if( barNum != 1 ) return;
That seemed to do the trick thanks a lot...I am getting the signal once the bar closes...so far....thanks,...
To add comments, please log in or register