![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
What do you mean by this?
i mean you will need to send the buy tally and sell tally as references to the check function so that you can read them on the tick so :
this tells the function that its using the object that saw sent and not creating a new one
I’m currently working on logic for multiple indicators.
The desired outcome is that indicators can be enabled and disabled individually. The expert should trade the logic of each individual indicator if only that indicator is enabled.
If multiple indicators are enabled the expert should combine the Logic and only place an order when the conditions for all enabled indicators are met.
Sounds simple but I’ve been having issues when multiple indicators are enabled. I’ve made different iterations of the code individual conditions work. RSI and Bollinger bands are giving problems and when both are enabled RSI, BB conditions combine. But if I enable EMA1, Or EMA2 or BothEMA. The expert just starts opening orders even when RSI and BB conditions aren’t met. It seems the issue is when Moving Average related logic is enable with another or multiple indicators.
I have provided 2 of the different styles of coding this logic I have tried.
Below is the original attempt to get the desired outcome.
With the above original version. All indicators work when when individually enabled. And when multiple are enabled the RSI and BB work together properly but if I then enable one of the Moving Average logics expert seems to place trade based on MA even when RSI and BB conditions aren’t met.
Below is another version.
with the version above the expert has completely stopped trading even if only one of the indicators are enabled. And of course when multiple are enabled it doesn’t open orders.
What should happen is let’s say RSI,BB and MA1 are enabled expert should only trade Buy when RSI and BB and MA1 conditions are all met.
Need guidance on what’s wrong as I’m aware there are experts that work on 8+ indicators.
Kind Regards
As your semantic is complex, probably a good hint is to elicitate all cases designing a Decision-Table, with all conditions (enable/disable indicators and indicators values comparisons) and actions (buy, sell or do nothing). So you'll visualize better all cases to simplify your coding.
As your semantic is complex, probably a good hint is to elicitate all cases designing a Decision-Table, with all conditions (enable/disable indicators and indicators values comparisons) and actions (buy, sell or do nothing). So you'll visualize better all cases to simplify your coding.
i mean you will need to send the buy tally and sell tally as references to the check function so that you can read them on the tick so :
this tells the function that its using the object that saw sent and not creating a new one
Any suggestions regarding conditions for each indicator.
Lastly for modularity would yo recommend keeping the necessary copybuffer as local variables for the indicators needed in that Void() logic. Instead of having it in OnTick
And
Kind Regards
Hello,
Any suggestions regarding conditions for each indicator.
Lastly for modularity would yo recommend keeping the necessary copybuffer as local variables for the indicators needed in that Void() logic. Instead of having it in OnTick
And
Kind Regards
Is there an indicator that does not work on its own ?
Is there an indicator that does not work on its own ?
No they all work on their own. I have managed to get them all working by playing around with the signs.
great good job . So its solved then
great good job . So its solved then