
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am getting both values from the closed bar for Buffer 0 and Buffer 1. The test is the difference between Green - Red being > 2 * the value of Red (on the LONG side)
e.g if Green = 0.0036 and Red = 0.0008 the difference is 0.0028 and this is > 2 * 0.0008
For the SHORT side it tests Difference Red - Green being > 2 * the value of Green
e.g if Red = 0.0036 and Green = 0.0008 the difference is 0.0028 and this is > 2 * 0.0008
It "seems" to be working correctly but I could not get it to print to screen so have been relying on it working as intended. But I have experienced this before thinking all was correct and then found out much later my logic or method was seriously flawed (like when I used int instead of double one time)
I am getting both values from the closed bar for Buffer 0 and Buffer 1. The test is the difference between Green - Red being > 2 * the value of Red (on the LONG side)
That isn't what you said a couple of posts back . . .
"My trigger to open an order is when the value of Green bars is numerically greater than 2 times the Red bar" i.e. green > 2.0 * red
What you have mentioned above, Green - Red being > 2 * the value of Red, can be simplified to green > (factor +1) * red
If you want to see what your values are you can use Print to send them to the Experts/Journal tab or use Comment to put them on the screen top left.
it's iCustom(NULL, 0, "IndiName",12,0,1) NULL is the current symbol, 0 for current timeframe, 12 period, Buffer 0, Closed candle.
I managed to print the values to the screen so the indicator settings are working. A typical result is 0.0012 so it's a double if I understand correctly. I am trying to get around having to use new values when a JPY pair is involved; hence I'm trying to use ratios.
The only thing I can't verify is if my formula is working because I'm not proficient at where and how to place the print to log. The EA works in strategy testing but I have never read about how to use the magnitude check for one value x being > * times the other
ie.
Does this help clarify? I appreciate any input here as I have "L" plates on
To know if it is valid code you have to know what type the parameters are you are using
NULL is the current symbol So like "EURUSD" that means NULL is a 'string'
The 1 is here bettter definied as bar number 1 then it is closed bar you can here have also an input of 6 that means the value of the indicator at bar 6
The current bar is bar 0
That isn't what you said a couple of posts back . . .
"My trigger to open an order is when the value of Green bars is numerically greater than 2 times the Red bar" i.e. green > 2.0 * red
What you have mentioned above, Green - Red being > 2 * the value of Red, can be simplified to green > (factor +1) * red
If you want to see what your values are you can use Print to send them to the Experts/Journal tab or use Comment to put them on the screen top left.
My mind can understand a thing but when it comes to explaining it, if I get it wrong, I am oblivious to my error. This is why I have re-edited my post after you picking-up on error(s), or me spotting them later. So I ask your understanding of this and thank you sincerely for your patience with me. Your solution is (now) obvious to me and I am kicking myself for not thinking of this solution earlier. Thanks Raptor
** Have made the changes suggested and it works :-) **Thanks Raptor
To know if it is valid code you have to know what type the parameters are you are using
NULL is the current symbol So like "EURUSD" that means NULL is a 'string'
The 1 is here bettter definied as bar number 1 then it is closed bar you can here have also an input of 6 that means the value of the indicator at bar 6
The current bar is bar 0