Hi all,
i have one doubt. I want to see some signals when bar close, but fr backtest, i want see signals in history. I use simple code, but when i try to generalize to previous bars of history, the calculations appears each tick and not when bar end. I use:
The question is i have alerts each tick and not when bar end.
What is the mystake or the correct logic?
Thank you very much.
Maybe is not posible,. Some help please??
Yhank you very much
Maybe is not posible,. Some help please??
Yhank you very much
Yes it is possible!
- Instead of "iTime()" use "Time[]" because you are using the current chart data.
- Instead of monitoring the "i" index (previous bars), just monitor the value of Time[0] (current Bar) and detect when it changes. Don't use Time[i], otherwise you will get thousands of alerts.
- To back-test the logic of your indicator, use the Strategy Tester (in Indicator and Visual mode) to test it as if it were in real-time, but against history data
The problem is that you say that you " want to see signals in history", then you show code that issues alerts for every bar in history. Why would you want that? You just get thousands of alerts.
If you want signals in history, use a buffer to show arrows
Only do alerts and reset newbar when you get a signal and i==0 if signals are calculated on current bars or i==1 if only calculated on closed bars
Yes it is possible!
- Instead of "iTime()" use "Time[]" because you are using the current chart data.
- Instead of monitoring the "i" index (previous bars), just monitor the value of Time[0] (current Bar) and detect when it changes. Don't use Time[i], otherwise you will get thousands of alerts.
- To back-test the logic of your indicator, use the Strategy Tester (in Indicator and Visual mode) to test it as if it were in real-time, but against history data
Thank you very much!!
I understood, and i am going to programm for your way!!
The problem is that you say that you " want to see signals in history", then you show code that issues alerts for every bar in history. Why would you want that? You just get thousands of alerts.
If you want signals in history, use a buffer to show arrows
Only do alerts and reset newbar when you get a signal and i==0 if signals are calculated on current bars or i==1 if only calculated on closed bars
Thank you very much for your reply, This option i like too. I prove this way too
Thank you very much!!
- Indicators do not use new bar code. Just alert when i==1 and has a signal.
- Handle your lookbacks properly and count down.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
i have one doubt. I want to see some signals when bar close, but fr backtest, i want see signals in history. I use simple code, but when i try to generalize to previous bars of history, the calculations appears each tick and not when bar end. I use:
The question is i have alerts each tick and not when bar end.
What is the mystake or the correct logic?
Thank you very much.