Download MetaTrader 5

EA with custom indicator

To add comments, please log in or register
Fatbardh Pakashtica
193
Fatbardh Pakashtica  
Can someone help me? I want to use the super trend indicator in my EA. If the trend is down he should open a sell trade and if the trend is up he should open a buy trend. I only need this simple method to understand the logic about that because I never work with an indicator and yes I am a beginner :D This indicator is not mine !
Files:
whroeder1
15561
whroeder1  
Ian Venner
2584
Ian Venner  

I dont like how that supertrend is coded.

Alain Verleyen
Moderator
32394
Alain Verleyen  
SDC:

I dont like how that supertrend is coded.

Can you explain ?
Ian Venner
2584
Ian Venner  
Yes it redraws the entire chart on every tick plus it uses some static arrays in the calculations that are limited to 5000 indexes I'm suprised it doesnt cause array out of range, and I dont like the way it draws a line between the trends when the trend changes.
Fatbardh Pakashtica
193
Fatbardh Pakashtica  
SDC:
Yes it redraws the entire chart on every tick plus it uses some static arrays in the calculations that are limited to 5000 indexes I'm suprised it doesnt cause array out of range, and I dont like the way it draws a line between the trends when the trend changes.

Can you recommend another indicator to identify the trend ?
Hector Pacheco
16715
Hector Pacheco  
Try it
Hector Pacheco
16715
Hector Pacheco  
Try it. Very good.
Files:
Fatbardh Pakashtica
193
Fatbardh Pakashtica  
Thank you Iwori Fx but I dont like these indicators ..
Ian Venner
2584
Ian Venner  
Faat94:

Can you recommend another indicator to identify the trend ?
I think I would prefer to use PSAR but you can use the supertrend one you have, it does work, My criticism of it was looking at it from a coding point of view.
Fatbardh Pakashtica
193
Fatbardh Pakashtica  

https://docs.mql4.com/indicators/icustom

But how can I Say to my EA if TrendUp do this and if the Trend is Down do this ? The indicator could be extern.

double val=iCustom(NULL,0,"super-trend",13,1,0);

How can I define if the trend is up or down ?

12
To add comments, please log in or register