Download MetaTrader 5

EA with custom indicator

To add comments, please log in or register
Interested in social trading? Read the article!
Fatbardh Pakashtica
193
Fatbardh Pakashtica 2014.04.30 23:00 
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
14514
whroeder1 2014.05.01 00:53  
Ian Venner
2584
Ian Venner 2014.05.01 06:49  

I dont like how that supertrend is coded.

Alain Verleyen
Moderator
30739
Alain Verleyen 2014.05.01 09:09  
SDC:

I dont like how that supertrend is coded.

Can you explain ?
Ian Venner
2584
Ian Venner 2014.05.01 16:09  
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 2014.05.01 18:06  
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
14775
Hector Pacheco 2014.05.01 19:13  
Try it
Hector Pacheco
14775
Hector Pacheco 2014.05.01 19:13  
Try it. Very good.
Files:
Fatbardh Pakashtica
193
Fatbardh Pakashtica 2014.05.01 21:17  
Thank you Iwori Fx but I dont like these indicators ..
Ian Venner
2584
Ian Venner 2014.05.01 22:42  
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 2014.05.02 11:18  

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