int TTT_handle=iCustom(_Symbol,_Period,0,"Trading the Trend.ex5",21,3,1,PRICE_CLOSE);
You shouldn't create the indicator handle anew on every
tick. This belongs into OnInit(). And what is this 0 supposed to do? You need to match the iCustom
parameters precisely.
Hi Lippmaje
Thank you for that advice. That makes a lot of sense. I appreciate your help.
Best regards
Mark
Addendum: After Lippmaje's advice, my EA works. Correct syntax was int TTT_handle=iCustom(_Symbol,_Period,"Trading the Trend.ex5",21,3,1,PRICE_CLOSE);
Interestingly enough, in various scripts I use
int TTT_handle=iCustom(_Symbol,_Period,0,"Trading the Trend.ex5",21,3,1,PRICE_CLOSE);
int TTT_handle=iCustom(_Symbol,_Period,,"Trading the Trend.ex5",21,3,1,PRICE_CLOSE);
int TTT_handle=iCustom(_Symbol,_Period,"Trading the Trend.ex5",21,3,1,PRICE_CLOSE);
Some work in the script but not the EA. Odd, but beyond the understanding of this poor excuse for a coder.
Again I thank you for your help. It made its first trade today and I made my first profit from it.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi. I am no coder, but I try hard, so don't flame me, refer me to documentation or treat me with disrespect. I'm stuck, I've spent weeks on this and I am asking for anyone who CAN program, to tell me where I'm wrong, please. Thank you in advance.
Problem: I have a custom indicator called Trading the Trend. It works fine and I can call the indicator in a script and use the data successfully. Buffer 5 is the indicator value.
I am trying to write an EA which triggers at the new candle (this much works fine, and I thank Raimund Bauer for the coding) BUT I have applied both the inbuilt iMA function and the iCustom function in exactly the same way. The comment line just shows me the output and I'll use the data later on. The iMA output MA20 is fine and the indicator is drawn on the chart during testing. It is correct and updates at each new candle. The iCustom output TTT5 is garbage and doesn't update at all, and is not drawn on the chart.
If someone can explain to me how to get this iCustom indicator working correctly I would be eternally grateful.