Hi,
I'm trying to check for a buy/sell position on 2 chart indicators and then attempting to wait X bars for rest of indicators to be true.
When I check the bars visually after a backtest , the trades seem to be totally not what I coded. I try to get the true condition of 2 chart indicators and then waiting for the rest with a counter. If the counter gets to X and still the trades are not true, then counter is reset.
Condition for buy trade is:
Bottom indicator is in red, bollinger squeeze is in red
Wait 5 bars, to see if AMA smoothe is green (2 window down after main chart) and aroon is above zero (1 window down after main chart)
Per the attached, this is not the case but the EA traded. My code is attached too. Any ideas what is wrong or obvious code errors? Thanks.
Please attach the correct file (just in case - *.txt is an INCORRECT file FORMAT).
Apologies, forgot to include the includes.
mql5book.zip is coded to follow Mql5Book folder within include folder
trade.zip is coded to follow Trade folder within include (should be default files)
Apologies, forgot to include the includes.
mql5book.zip is coded to follow Mql5Book folder within include folder
trade.zip is coded to follow Trade folder within include (should be default files)
Sorry, but again a million mistakes.
My advice: create a minimal example that consists of a single file.
Sorry, but again a million mistakes.
My advice: create a minimal example that consists of a single file.
Hi,
Did a stripped down version as much as I could without it being too simple to not replicate the issue I am having. Copy the zip contents to your metaeditor directory, as the folder structure has been preserved. Compiled on a fresh version of MT5 with another broker as well to make sure and works fine.
EA is called test9 and uses the code that you previously helped me with in another thread. Same issue happens again. The bottom indicator window (trend trigger) in the attached screenshot is supposed to be red and within 5 bars later other criteria is checked.
You are creating the 'Trend trigger factor - mtf' indicator WRONG.
You need to be more careful with the input parameters.
You are creating the 'Trend trigger factor - mtf' indicator WRONG.
You need to be more careful with the input parameters.
Thanks - silly error on my part really.
I believe i've fixed this and then I removed all logic. The call is now
handle_iCustom3 = iCustom(_Symbol,_Period,"Trend trigger factor - mtf",inpTrendTimeFrame,inpTrendPeriod,inpTrendT3Period,inpTrendT3Hot,inpTrendT3Type,inpTrendLevels,inpTrendInterpolate);
The script is just looking for the colours now (see code attached, please use in line with the other includes I attached before) - Red Buy (valc_tr[0] ==2) or Blue Sell (valc_tr[0] == 1) but the trades do not seem to match up to this logic. Is there anything else wrong or that does not look right? A buy trade in the attached screenshot should be looking at the value of 2 but it's showing 1 here.
Thanks - silly error on my part really.
I believe i've fixed this and then I removed all logic. The call is now
The script is just looking for the colours now (see code attached, please use in line with the other includes I attached before) - Red Buy (valc_tr[0] ==2) or Blue Sell (valc_tr[0] == 1) but the trades do not seem to match up to this logic. Is there anything else wrong or that does not look right? A buy trade in the attached screenshot should be looking at the value of 2 but it's showing 1 here.
It's hard for me to follow your thoughts - I don't understand at all what you are doing that you don't like? What is not working for you?
Remember - this is a technical forum: Your task is to describe the task in detail so that everyone can reproduce it.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm trying to check for a buy/sell position on 2 chart indicators and then attempting to wait X bars for rest of indicators to be true.
When I check the bars visually after a backtest, the trades seem to be totally not what I coded. I try to get the true condition of 2 chart indicators and then waiting for the rest with a counter. If the counter gets to X and still the trades are not true, then counter is reset.
Condition for buy trade is:
Bottom indicator is in red, bollinger squeeze is in red
Wait 5 bars, to see if AMA smoothe is green (2 window down after main chart) and aroon is above zero (1 window down after main chart)
Per the attached, this is not the case but the EA traded. My code is attached too. Any ideas what is wrong or obvious code errors? Thanks.