Re: Coding Help

1721
mrtools wrote: Mon Jan 13, 2025 12:24 am It's an expert advisor, this is what I get. When compiling it gives a lot of benign warnings which doesn't seem to affect it.
An Expert Advisor. Well that may be why it doesn’t work as an indicator. I appreciate you taking a Quick Look and explaining that to me.

Thank you Mr Tools.
These users thanked the author RACER-X for the post:
mrtools


Re: Coding Help

1722
RACER-X wrote: Sun Jan 12, 2025 10:15 pm Dear Mr. Tools. I have this older custom dash indicator that was custom made for me some time ago by some close friends of mine. It won't load anymore. Can you please look at it for me?

If you can't get it going, then can you refer me to someone who might be able to help?


ish
This version compiles without any warnings and seems to be working.
These users thanked the author mrtools for the post (total 2):
RACER-X, mazibee

Re: Coding Help

1724
Jawnger wrote: Wed Jan 15, 2025 1:43 am Hi!Com.mq4

I'm not a coder, I was looking for a simple buffers combiner indicator and found this code. But I couldn't get it to work correctly (tried several indicator buffers), I think there is some problem with the code. Can anyone help me? or can anyone recommend a ready-made indicator with similar functions?
Only thing I can find is it needs "mt2trading_library.ex4" in your libraries folder, after that not sure.
These users thanked the author mrtools for the post:
Jawnger


Re: Coding Help

1730
almostprofitable101 wrote: Wed Jan 29, 2025 9:20 am hello again i am trying to add alerts to an indicator but im getting 1 error any help please 🙌
(i added this section of code from another indicator so not sure if its correct method for alerts 🤦‍♂️ )
In the alert function, where the [i] and [i+1] try changing it to [whichBar] and [whichBar+1]. Also maybe change

Code: Select all

for(i=limit;i>=0;i--)
     {
      bufferUP[i-1]=EMPTY_VALUE; bufferDN[i-1]=EMPTY_VALUE;
      
      if(Down[i]!=0 && ExtMapBuffer2[i]>0 && jrhi[i]!=EMPTY_VALUE && jrhi[i]!=0 && (Up[i+1]!=0 || ExtMapBuffer1[i+1]>0 || (jrlo[i+1]!=EMPTY_VALUE && jrlo[i+1]!=0)))
        {
         bufferUP[i-1]=Low[i-1]-0.5*iATR(_Symbol,0,5,i);
        }
      
      else if(Up[i]!=0 && ExtMapBuffer1[i]>0 && jrlo[i]!=EMPTY_VALUE && jrlo[i]!=0 && (Down[i+1]!=0 || ExtMapBuffer2[i+1]>0 || (jrhi[i+1]!=EMPTY_VALUE && jrhi[i+1]!=0)))
        {
         bufferDN[i-1]=High[i-1]+0.5*iATR(_Symbol,0,5,i);
        }
     }
to

Code: Select all

for(i=limit;i>=0;i--)
     {
      bufferUP[i]=EMPTY_VALUE; bufferDN[i]=EMPTY_VALUE;
      
      if(Down[i]!=0 && ExtMapBuffer2[i]>0 && jrhi[i]!=EMPTY_VALUE && jrhi[i]!=0 && (Up[i+1]!=0 || ExtMapBuffer1[i+1]>0 || (jrlo[i+1]!=EMPTY_VALUE && jrlo[i+1]!=0)))
        {
         bufferUP[i]=Low[i]-0.5*iATR(_Symbol,0,5,i);
        }
      
      else if(Up[i]!=0 && ExtMapBuffer1[i]>0 && jrlo[i]!=EMPTY_VALUE && jrlo[i]!=0 && (Down[i+1]!=0 || ExtMapBuffer2[i+1]>0 || (jrhi[i+1]!=EMPTY_VALUE && jrhi[i+1]!=0)))
        {
         bufferDN[i]=High[i]+0.5*iATR(_Symbol,0,5,i);
        }
     }
These users thanked the author mrtools for the post:
almostprofitable101