Sometimes index buffers don't really get set while you are still in the loop.
I have had to create a second loop to see values... after the first loop has completed.
Don't know why.
Also, you are dividing a double by an integer --
Tenkan_Buffer[i]=(high+low)/2;
change to
Tenkan_Buffer[i]=(high+low)/2.0;
I think this is the standard code that gets shipped with the Ichimoku indicator but I'll check that.
Will this do it for the alert? If I want to compare it to the previoud value is i=+1 or -1 ? Logically it should be -1 but I've seen different code.
//----ALERTS //---- TS cross KS if (Tenkan_Buffer[0] > Kijun_Buffer[0] && Tenkan_Buffer[-1] < Kijun_Buffer[-1]) { //crossed upwards Alert ("TS crossed KS upwards on+ "+Symbol());} if (Tenkan_Buffer[0] < Kijun_Buffer[0] && Tenkan_Buffer[-1] > Kijun_Buffer[-1]) { //crossed downwards Alert ("TS crossed KS downwards on+ "+Symbol());}
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
I am trying to list the value of the tenkan sen but it keeps displaying 0.00000
Any ideas?