- To help you we would need more information, either more code or detailed, what you EA 'thinks' ion the tester!
- Faster for you would be if you let your EA show that it 'thinks' in the tester using Comment() and the Visual mode!
- There are really a lot of EAs that are trading that way - search for them and look how they do it. (I am repeating myself: Why trying to event the wheel while it is already available for free!)
Look e.g. for an EA that uses the Alligator.
Carl Schreiber:
- To help you we would need more information, either more code or detailed, what you EA 'thinks' ion the tester!
- Faster for you would be if you let your EA show that it 'thinks' in the tester using Comment() and the Visual mode!
- There are really a lot of EAs that are trading that way - search for them and look how they do it. (I am repeating myself: Why trying to event the wheel while it is already available for free!)
- Look e.g. for an EA that uses the Alligator.
Check it out, it worths a million.
//----------------------------------------- internal variables ---!
double UPtrend=Ask>iMA(NULL,0,SlowMAPeriod,0,MODE_LWMA,PRICE_CLOSE,0);
double DOWNtrend=Bid<iMA(NULL,0,SlowMAPeriod,0,MODE_LWMA,PRICE_CLOSE,0);
double FastMA=iMA(NULL,0,FastMAPeriod,0,MODE_SMMA,PRICE_CLOSE,0);
int BUYsignal=UPtrend&&Open[0]<FastMA&&Close[0]>FastMA;
int SELLsignal=DOWNtrend&&Open[0]>FastMA&&Close[0]<FastMA;
int TheTakeProfit=TakeProfit+MarketInfo(Symbol(),MODE_SPREAD);
int TheBreakPoint=BreakPoint+MarketInfo(Symbol(),MODE_SPREAD);
int cnt,ticket,slippage=3;
- As Ask > Bid it could happen that slowMa lays between Ask and Bid so you have at the same time an up and a down trend - is that you intention?
- For me your approach would be too unsafe if e.g. the fastMA == Open[0] and the Close[0] swings around the fastMA you'll get more signals than you want to have I guess
- I don't want to imagine what happens to your millions if 1. and 2. become true at the same time!
Carl Schreiber:
1. I had not noticed that possibility, however the signal would respond to the direction taken by the candle.- As Ask > Bid it could happen that slowMa lays between Ask and Bid so you have at the same time an up and a down trend - is that you intention?
- For me your approach would be too unsafe if e.g. the fastMA == Open[0] and the Close[0] swings around the fastMA you'll get more signals than you want to have I guess
- I don't want to imagine what happens to your millions if 1. and 2. become true at the same time!
2. It is evident that this need some layers of makeup, but it's just an example. So we can consider the following:
· int BUYsignal = UPtrend && Open [0] <= FastMA && Close [0]> FastMA;
· int SELLsignal = DOWNtrend && Open [0]>= FastMA && Close [0] <FastMA;
3. But we need this to work! I send you the file by private message and you take a look, do you agree?

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi, I'm trying to make a clean price intersection expert advisor with no success till now, I think the code is right but the backtester doesn't think the same.
These are the critical points:
- Opening candle price below the moving average and close price upwards for BUY:
double BUYsignal=UPtrend&&Open[0]<FastMA&&Close[0]>FastMA;
- Opening candle price above the moving average and close price downwards for SELL:
double SELLsignal=DOWNtrend&&Open[0]>FastMA&&Close[0]<FastMA;
If someone can help me to fix this issue would be great.