#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_width1 3
#property indicator_width2 3
//| Custom indicator initialization function |
//| Custom indicator deinitialization function |
//| Custom indicator iteration function |
int limit, counted_bars=IndicatorCounted();
limit = Bars - counted_bars - 1;
SAR = iSAR(Symbol(),0,0.01,0.1,i);
MA = iMA(Symbol(),0,14,0,MODE_SMA,PRICE_CLOSE,i);
if(SAR < Close)
Uptrend = MA;
Dntrend = EMPTY_VALUE;
if(SAR Close) Dntrend = MA;
if(SAR > Close)
Dntrend = MA;
Uptrend = EMPTY_VALUE;
if(SAR > Close && SAR < Close) Uptrend = MA;
Use EA Builder Templates To Learn Coding
There are a number of EA builder templates on the internet and Forex forums to let you learn how to build your own EA's.
Here is one website for a basic EA Builder called Expert Advisor Builder for MT4.
This for me is the most simple EA Template to start learning with.
Expert Advisor Builder for MetaTrader 4
It only uses the basic built-in indicators to start with, so you can't add your iCustom statements into the online template.
But....after you see the basic structure of this EA template...you can search and find many EA's already using this EA Builder template...and you can use them to compare the iCustom statements and learn from the code.
When you are ready, save and rename the EA samples you want to play with, and replace the iCustom statements and related variables and Buy/Sell conditions with your own.
The key to identifying this particular Expert Advisor Builder is the lines at the top that define the signals:
#define SIGNAL_NONE 0
#define SIGNAL_BUY 1
#define SIGNAL_SELL 2
#define SIGNAL_CLOSEBUY 3
#define SIGNAL_CLOSESELL 4
* Note - WHRoeder has nicely pointed out a number of coding inefficiencies for this EA template, but it's a great basic EA template to use and learn from. And because it's pretty modular, it's very easy to add and change the iCustom statements and Buy/Sell conditions, then recompile and test in the Strategy Tester.
You will be starting on a very exciting, sometimes frustrating, but always rewarding adventure in coding EA's... Careful...coding can be addicting...!
Good luck and God's Speed.
Hope this helps,
Robert,I'm really green to all this coding. It's really confusing. I'll take my time to learn all this. Thanks for your assistance though.
Would you like to get your EA coded for free? If you can make the fellow members feel that your strategy is profitable and if you're willing to share the EA with the community, I can do the coding for free.
Due to my professional commitments, I can only take up limited number of request
But I'm looking to work on some unique and profitable strategy.
Apart from this, If you would not want to share your strategy or if you cannot wait for a long time, you can hire me to do coding on which case the code will not shared with anyone else
Hi Karthik,I've an EA to be further developed.However,I am really green to all this coding stuffs.Therefore,can you please kindly assist me in this EA development?Hope to hear from you soon.
I have an idea for an EA that can use you indicator. You care to view the requirements and perhaps it can be used for other indicators as well.
A friend and I came up with some EA requirements based on live trading techniques that needs to be converted into an EA. So the conditions were tested and traded live and does not involve guesswork.
Care for me to paste the conditions here? Let me know.
I need help to program custom indicator into a trading EA. But I know nothing about programming. Can someone help me out here ?
Hi buddy..I'm ok with it..Like I've said,suggestions and recommendations are most welcome to develop the EA better..For myself,currently,I'm using the indicator together with SMA,Parabolic,MACD and Fractals to maximise the profits cos I don't wish to enter late or exit late. That has been the problem with me before which caused my accounts to burst. And I don't wish to repeat that mistake again. Let's take a look at the example I've attached.
1)There is a MACD crossover which is a buy/sell signal for us.(Better to have a MACD crossover signal indicator)
2)I will place stop loss few pips below the previous support/resistance fractal.Placing a trailing stop loss is always good for traders.
3)Looking at the parabolic and the trend predictor,it gives us confirmation that we're heading to the right direction.
4)Exit when the parabolic flips/MACD crossover/change in trend predictor/fractal appears before MACD crossover.
If possible,all these can be integrated and become a powerful EA. Hope to develop the EA with more incoming ideas. Thank you.
Some of the indicators you posted won't work. I noticed that you pointed out the MACD in the area where the market oscillates and not trends so it looks exceptionally well in that region. I do have suggestions to fix that though and it's only a suggestion.
Throw in the zerolag stochastic instead of your RSI indicator and have it set to 2 time frames above the time frame you wish to trade off. However, trade in the direction when the red and blue are sloping simultaneously.
What do you think? I think this will improve probabilty much more until the next time frame takes over.
I also have conditions for the EA to make it more successful. When we get to that stage I will post them ok?
Yes,why not? I've no issue with your suggestion. On my part, I can only give ideas. But when it comes to coding,frankly speaking, I've to rely on you guys who have much more experience in coding. But it would be better if we could come up with an EA which can auto-trade for us. Cos I believe nobody wants to stick to their screen the whole day. Hope to try out the redeveloped EA as soon as possible. You guys are great...
first i want said sorry my english is not good ,i hope you can understand what i mean ..,i'm from indonesia few month ago i get EA name is avtoforex.. this EA
this EA for all pair and all TF, usualy i used on gbbusd and uerusd TF H1(on mini account),this EA is avarage EA .. ,
i want to disable thats average dan when open the position buy or sell this EA sometime on candle body
that why i want put zigzag indicator (modifiyHigh_Low v2 (ZigZag)),so i hope when i put theat indicator can make this
EA can be better
i hope you can help me ..thank you and please