Page 1 of 1

I need help with a single line of code

Posted: Thu Jul 01, 2021 11:11 pm
by ronald828
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

Posted: Thu Jul 01, 2021 11:55 pm
by mrtools
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
)

Re: I need help with a single line of code

Posted: Fri Jul 02, 2021 12:09 am
by ronald828
Thank you very much

Re: I need help with a single line of code

Posted: Fri Jul 02, 2021 1:09 am
by blonde
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)

Re: I need help with a single line of code

Posted: Fri Jul 02, 2021 1:39 am
by moey_dw
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:

Re: I need help with a single line of code

Posted: Sat Jul 03, 2021 1:33 am
by ronald828
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