iCustom Call Problem

Locked
steven
Posts: 9
Joined: Sun Jul 03, 2016 5:54 pm

iCustom Call Problem

Post by steven »

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 do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

iCustom Call Problem

Post by SteveHopwood »

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:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
steven
Posts: 9
Joined: Sun Jul 03, 2016 5:54 pm

iCustom Call Problem

Post by steven »

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);
Radar
Trader
Posts: 437
Joined: Fri Mar 23, 2012 5:39 pm
Location: Round the bend ;)

iCustom Call Problem

Post by Radar »

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^)
Check out my new, (well, old now), manual trade & automatic scale-in manager,
StackManV2
Sandy
Trader
Posts: 16
Joined: Sun Apr 24, 2016 12:33 pm

iCustom Call Problem

Post by Sandy »

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 :)
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

iCustom Call Problem

Post by SteveHopwood »

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.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Locked

Return to “Coders Hangout”