Page 173 of 180

Re: Coding Help

Posted: Mon Jan 13, 2025 12:45 am
by RACER-X
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.

Re: Coding Help

Posted: Mon Jan 13, 2025 12:51 am
by mrtools
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.

Re: Coding Help

Posted: Wed Jan 15, 2025 1:43 am
by Jawnger
Hi!

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?

Re: Coding Help

Posted: Wed Jan 15, 2025 5:18 am
by mrtools
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.

Re: Coding Help

Posted: Wed Jan 15, 2025 8:12 am
by Jawnger
1

Re: Coding Help

Posted: Thu Jan 16, 2025 6:02 am
by almostprofitable101
hello i was trying to edit this from looking at other indicators with color change button it compiles but does not change πŸ˜’.
i changed/added a few lines if anybody can help ?

Re: Coding Help

Posted: Thu Jan 16, 2025 10:23 am
by kvak
almostprofitable101 wrote: Thu Jan 16, 2025 6:02 am hello i was trying to edit this from looking at other indicators with color change button it compiles but does not change πŸ˜’.
i changed/added a few lines if anybody can help ?
Hello. Not perfect code, but try...

Re: Coding Help

Posted: Thu Jan 16, 2025 10:39 am
by almostprofitable101
kvak wrote: Thu Jan 16, 2025 10:23 am Hello. Not perfect code, but try...
there was abit more extra to add then i thought πŸ€¦β€β™‚οΈ, sometimes i get it right when i rough code looking at other indicators (usually adding alerts) πŸ˜‚,
but i will continue trying before knowing when its too much and asking for help & thanks πŸ‘Œ

Re: Coding Help

Posted: Wed Jan 29, 2025 9:20 am
by almostprofitable101
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 πŸ€¦β€β™‚οΈ )

Re: Coding Help

Posted: Wed Jan 29, 2025 10:19 am
by mrtools
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);
        }
     }