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

Help with coding an Indicator using && and ||
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4579
Page 1 of 1
Author:  xray2 [ Sat Jan 23, 2016 2:03 pm ]
Post subject:  Help with coding an Indicator using && and ||

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
      )
Author:  SteveHopwood [ Sun Jan 24, 2016 1:00 am ]
Post subject:  Help with coding an Indicator using && and ||

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:
All times are UTC Page 1 of 1