stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

iCustom Call Problem
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4855
Page 1 of 1
Author:  steven [ Sun Aug 07, 2016 5:09 pm ]
Post subject:  iCustom Call Problem

Any one can help to check how to make iCustom call from this indicator ?
I have no idea , why it does not work . :arrrg:
If have any mistake , please correct me .
Thank you .

Code: Select all

   //|---------main signal
   
for(int i=Bars-1; i>=0; i--)
      double trendCurr = iCustom(Symbol(),0,"halftrend-1.02",Amplitude,false,false,false,false,false,false,false,6,i);
      double trendPrev = iCustom(Symbol(),0,"halftrend-1.02",Amplitude,false,false,false,false,false,false,false,6,i+1);

      bool BUY=false;
      bool SELL=false;
      
      if(trendCurr==1)BUY=true;
      if(trendCurr==-1)SELL=true;
      
      bool SignalBUY=false;
      bool SignalSELL=false;
      
      if(BUY)if(ReverseSystem)SignalSELL=true;else SignalBUY=true;
      if(SELL)if(ReverseSystem)SignalBUY=true;else SignalSELL=true;
      
   }
Author:  SteveHopwood [ Sun Aug 07, 2016 5:21 pm ]
Post subject:  iCustom Call Problem

steven » Sun Aug 07, 2016 5:09 pm wrote:Any one can help to check how to make iCustom call from this indicator ?
I have no idea , why it does not work . :arrrg:
If have any mistake , please correct me .
Thank you .

Code: Select all

   //|---------main signal
   
for(int i=Bars-1; i>=0; i--)
      double trendCurr = iCustom(Symbol(),0,"halftrend-1.02",Amplitude,false,false,false,false,false,false,false,6,i);
      double trendPrev = iCustom(Symbol(),0,"halftrend-1.02",Amplitude,false,false,false,false,false,false,false,6,i+1);

      bool BUY=false;
      bool SELL=false;
      
      if(trendCurr==1)BUY=true;
      if(trendCurr==-1)SELL=true;
      
      bool SignalBUY=false;
      bool SignalSELL=false;
      
      if(BUY)if(ReverseSystem)SignalSELL=true;else SignalBUY=true;
      if(SELL)if(ReverseSystem)SignalBUY=true;else SignalSELL=true;
      
   }
You are interrogating buffer 6, but the data window shows only 5 buffers. Indi's count their 8 buffers from 0 to 7. The indi only uses buffers 0 to 5.

The box in the data window that shows "halftrend-1.02" references buffer 0. The box with "Value 2" in it references buffer 1. "Value 2" is buffer 1 and so on.

Crazy. Lunatic. Infantile. Pathetic. Moronic, but the reality we have to put up with.

Welcome to my world. :arrrg: :arrrg: :arrrg:

:xm:
Author:  steven [ Sun Aug 07, 2016 5:37 pm ]
Post subject:  iCustom Call Problem

Yes you are right , i just check it on data window .
Because i follow the buffer form the indicator , so i though i can use buffer 6 for a trend signal.

Code: Select all

   IndicatorBuffers(7); // +1 buffer - trend[]
   
   SetIndexBuffer(0,up);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(1,down);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(2,atrlo);
   SetIndexBuffer(3,atrhi);
   SetIndexBuffer(6,trend);
   SetIndexBuffer(4,arrup);
   SetIndexBuffer(5,arrdwn);
   SetIndexEmptyValue(0,0.0);
   SetIndexEmptyValue(1,0.0);
   SetIndexEmptyValue(6,0.0);
Author:  Radar [ Fri Aug 12, 2016 12:24 pm ]
Post subject:  iCustom Call Problem

SteveHopwood » Mon Aug 08, 2016 3:51 am wrote: You are interrogating buffer 6, but the data window shows only 5 buffers. Indi's count their 8 buffers from 0 to 7. The indi only uses buffers 0 to 5.

The box in the data window that shows "halftrend-1.02" references buffer 0. The box with "Value 2" in it references buffer 1. "Value 2" is buffer 1 and so on.

Crazy. Lunatic. Infantile. Pathetic. Moronic, but the reality we have to put up with.

Welcome to my world. :arrrg: :arrrg: :arrrg:

:xm:
It is Crazy, Lunatic, etc, but it's also bog standard with computers :( For many years, Zero was the first number when counting anything on computers... It's the same reason why the first element in an array is element zero.

At first, it seems there's a madness to the method, but after you've come across it a few (hundred in my case) times, you begin to see the method in the madness ;)

Have fun!

Radar =8^)
Author:  Sandy [ Tue Aug 16, 2016 11:47 am ]
Post subject:  iCustom Call Problem

Radar » Fri Aug 12, 2016 2:24 pm wrote:
SteveHopwood » Mon Aug 08, 2016 3:51 am wrote: You are interrogating buffer 6, but the data window shows only 5 buffers. Indi's count their 8 buffers from 0 to 7. The indi only uses buffers 0 to 5.

The box in the data window that shows "halftrend-1.02" references buffer 0. The box with "Value 2" in it references buffer 1. "Value 2" is buffer 1 and so on.

Crazy. Lunatic. Infantile. Pathetic. Moronic, but the reality we have to put up with.

Welcome to my world. :arrrg: :arrrg: :arrrg:

:xm:
It is Crazy, Lunatic, etc, but it's also bog standard with computers :( For many years, Zero was the first number when counting anything on computers... It's the same reason why the first element in an array is element zero.

At first, it seems there's a madness to the method, but after you've come across it a few (hundred in my case) times, you begin to see the method in the madness ;)

Have fun!

Radar =8^)
And Zero has been even for longer the first number to us humans :)
Author:  SteveHopwood [ Tue Aug 16, 2016 9:13 pm ]
Post subject:  iCustom Call Problem

Sandy » Tue Aug 16, 2016 11:47 am wrote:
And Zero has been even for longer the first number to us humans :)
I do not care about the perversions shown by the mathematicians until they are inflicted upon me.

No, what is driving me nuts here and has done for many years is the fact that crap custom abortions refer to such as Index1 in the data window when in fact Index1 is Buffer0 without telling us this. What the fuck is that all about. Have you any idea how much pain this cause me when I first met these fucking things. Commenting on that is what I mean when I welcome some poor sap to my world. You really think that every noob coder instantly grasps this? Dream on. It causes agony.

Did I not make myself perfectly clear when posting my rant about this?

Did I mistakenly, um by mistake, um get it wrong, by using the occasional more-than-one syllable um two-part or three-part word.

Have I ever mentioned that I do not really appreciate it when people cannot be bothered to read my posts properly.

Good luck. Hmmmmm, that last sentence will not do. Nope. I will try um.... I know. I will try once more.

That last bit had words with more than one bit in them. I do not like it when folks read my posts in their sleep.

I trust I make my point.
All times are UTC Page 1 of 1