Help with coding an Indicator using && and ||

Locked
xray2
Posts: 9
Joined: Tue Dec 08, 2015 3:19 am

Help with coding an Indicator using && and ||

Post by xray2 »

Hi all,
Once again I want to say that I'm and absolute newbie in coding and I am just teaching myself.
I am trying to code and indicator arrow where I need each several conditions to be met and used the && function.

I then require only one 3 or 4 other conditions to be met and I use the || function. But this where my limitations as a coder are exposed as I seem to be having a few errors.

Below is a piece of the code I am trying put together. Any assistance to fixing my errors would be grateful.

Code: Select all

//Indicator Buffer 1
      if (iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX1, true, 0, 1, i) <= Increase_BuyThreshold && iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX1, true, 0, 1, i) > 0  //SDV-ADX histogram oscillator <= fixed value but greater than 0
      && iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX2, true, 0, 1, i) <= Increase_BuyThreshold && iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX2, true, 0, 1, i) > 0  //SDV-ADX histogram oscillator <= fixed value but greater than 0
      && iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX3, true, 0, 1, i) <= Increase_BuyThreshold && iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX3, true, 0, 1, i) > 0  //SDV-ADX histogram oscillator <= fixed value but greater than 0
      && iCCI(NULL, PERIOD_CURRENT, CCIPeriod, PRICE_TYPICAL, i) > 0 //Commodity Channel Index > fixed value
      && iCCI(NULL, PERIOD_CURRENT, CCIPeriod, PRICE_TYPICAL, i) < 200 //Commodity Channel Index < fixed value
      && iRSI(NULL, PERIOD_CURRENT, RSI_Period, PRICE_CLOSE, i) >= 50 //Relative Strength Index >= fixed value
      && iRSI(NULL, PERIOD_CURRENT, RSI_Period, PRICE_CLOSE, i) < RSI_OverBought //Relative Strength Index < fixed value
      )
      && ((iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX1, true, 0, 2, 1+i) != 0 && iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX1, true, 0, 2, 1+i != EMPTY_VALUE)  //SDV-ADX histogram oscillator is not equal to fixed value
      || (iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX2, true, 0, 2, 1+i) != 0 && iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX2, true, 0, 2, 1+i) != EMPTY_VALUE ) //SDV-ADX histogram oscillator is not equal to fixed value
      || (iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX3, true, 0, 2, 1+i) != 0 && iCustom(NULL, PERIOD_CURRENT, "SDV-ADX histogram oscillator", ADX3, true, 0, 2, 1+i) != EMPTY_VALUE ) //SDV-ADX histogram oscillator is not equal to fixed value           
      || (iCCI(NULL, PERIOD_CURRENT, CCIPeriod, PRICE_TYPICAL, 1+i) < 0) //Commodity Channel Index < fixed value
      || (iRSI(NULL, PERIOD_CURRENT, RSI_Period, PRICE_CLOSE, 1+i) < 50)) //Relative Strength Index < fixed value
      )
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.

Help with coding an Indicator using && and ||

Post by SteveHopwood »

xray2, I am being kind here. Trust me, you will know when I am being blunt.

Are you certifiably bonkers?

In your wildest dreams/most lurid nightmares, what makes you think for even a second that anybody with a firing synapse is going to get involved here?

Only a cretin with a forum death wish tries to invoke the sort nonsense that you have presented here.

I think you are probably a well meaning moron, so I am not banning you.

Yet.

I am locking this demented thread to give you time to think carefully before insulting the membership here again. Post again in like vein and your account deletion is assured.

I have placed you in the On Moderation group, so that your posts will require approval before they are published. You will have to prove yourself worthy of membership of SHF for this to happen without moderator approval.

: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.
Locked

Return to “Coders Hangout”