CodeI need help with a single line of code

1
The EA builder I am using will not give the option of choosing which bar for the indicator value, only the bar just closed. How can I change the second part of the condition to reference the indicator value for the bar previous to the bar just closed?

if(iCustom(NULL, PERIOD_CURRENT, "Jurik filter", PERIOD_CURRENT, 50, 0.0, false, 17, 0, 2, 0, 0, 3, true, 2, 2, 159, 159, 0.5, 0.5, clrLimeGreen, clrOrange, true, 0, 0) > iCustom(NULL, PERIOD_CURRENT, "Jurik filter", PERIOD_CURRENT, 50, 0.0, false, 17, 0, 2, 0, 0, 3, true, 2, 2, 159, 159, 0.5, 0.5, clrLimeGreen, clrOrange, true, 0, 0) //Jurik filter > Jurik filter
)


I want to compare the indicator value of the bar just closed (is greater than) with the same indicator value for the previous bar


Re: I need help with a single line of code

2
ronald828 wrote: Thu Jul 01, 2021 11:11 pm The EA builder I am using will not give the option of choosing which bar for the indicator value, only the bar just closed. How can I change the second part of the condition to reference the indicator value for the bar previous to the bar just closed?

if(iCustom(NULL, PERIOD_CURRENT, "Jurik filter", PERIOD_CURRENT, 50, 0.0, false, 17, 0, 2, 0, 0, 3, true, 2, 2, 159, 159, 0.5, 0.5, clrLimeGreen, clrOrange, true, 0, 0) > iCustom(NULL, PERIOD_CURRENT, "Jurik filter", PERIOD_CURRENT, 50, 0.0, false, 17, 0, 2, 0, 0, 3, true, 2, 2, 159, 159, 0.5, 0.5, clrLimeGreen, clrOrange, true, 0, 0) //Jurik filter > Jurik filter
)


I want to compare the indicator value of the bar just closed (is greater than) with the same indicator value for the previous bar
Try like this

Code: Select all

if(iCustom(NULL, PERIOD_CURRENT, "Jurik filter", PERIOD_CURRENT, 50, 0.0, false, 17, 0, 2, 0, 0, 3, true, 2, 2, 159, 159, 0.5, 0.5, clrLimeGreen, clrOrange, true, 0, 1) > iCustom(NULL, PERIOD_CURRENT, "Jurik filter", PERIOD_CURRENT, 50, 0.0, false, 17, 0, 2, 0, 0, 3, true, 2, 2, 159, 159, 0.5, 0.5, clrLimeGreen, clrOrange, true, 0, 2) //Jurik filter > Jurik filter
)
These users thanked the author mrtools for the post:
moey_dw

LikeRe: I need help with a single line of code

5
blonde wrote: Fri Jul 02, 2021 1:09 am EA do not like long iCustom chains, it is much more convenient to edit the code of the indicator itself, for example, I left only one parameter (period) for it
iCustom(NULL, PERIOD_CURRENT, "Jurik filter for EA", 17, 0, 0)
u are talented........... yes very good point about ea not liking long icustom!!! nice work/files blond :thumbup: :thumbup: :thumbup:
Official Forex-station GIF animator at your service 👨‍⚖️
See a GIF with Forex-station.com on it? I probably made it
The best divergence indicator in the world.
Real news exists: Infowars.com 👈


Re: I need help with a single line of code

6
blonde wrote: Fri Jul 02, 2021 1:09 am EA do not like long iCustom chains, it is much more convenient to edit the code of the indicator itself, for example, I left only one parameter (period) for it
iCustom(NULL, PERIOD_CURRENT, "Jurik filter for EA", 17, 0, 0)
Ok. I have little experience with this code and I used the EA Builder site to create the EA. Thanks for the advice


Who is online

Users browsing this forum: Amazon [Bot] and 26 guests