Buy Signal - Before Candle Closing

Hi,
How to generate a Buy Signal just before candle closing.i.e assume that i am using 5 min timeframe and i want buy signal to be generated at 4 minutes 59 second.

kindly suggest.

In real time?

Run a scan/exploration shortly before close.

Yes. In real time.

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

the above giving buy or sell signal during the formation of the candle itself, instead it should give signal on the close candle or 1 second before closing(once candle is completely formed).

Tomasz, i am beginner, kindly excuse incase any difficulties in understanding the question.

First, ExRems are NOT NEEDED.

Second, if you want to act on completed bar you should act on bar that is NOT last, see:

If you want to act upon incomplete bar but "near its ending" - as I wrote - run scan BEFORE bar close.

The way you ask questions is far from complete. You do not provide CONTEXT in which you run code and you did not really provide any formula (sorry but 2 line ExRem is NOT complete formula) Please follow this advice: How to ask a good question

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.