hello guys. So I was trying to build an EA that utilises bars of multiple timeframes to gather information for trading. Now i'm struggling with an issue where if I try to run the code on a lower timeframe chart it can't seem to access the adequate number of bars it needs on the higher timeframe charts. This causes my EA to crash with an array out of range error whenever I run it a LTF chart however it seems to run properly when I run it on the highest timeframe chart. I need the EA to run on the smaller timeframes but it only seemes to be able to allocate a certain number of bars to the history cache for the higher timeframe candles(according to my console/journal). Please how do I fix this.
- ISsue with Creating an indicator buffer that stores values for different timeframe (than the chart) and should be accessed by EA
- How can I run the function with a button without waiting for a tick change for OnCalculate to work? [MT5]
- One trade per candle on lower timeframe.
clyde50:
hello guys. So I was trying to build an EA that utilises bars of multiple timeframes to gather information for trading. Now i'm struggling with an issue where if I try to run the code on a lower timeframe chart it can't seem to access the adequate number of bars it needs on the higher timeframe charts. This causes my EA to crash with an array out of range error whenever I run it a LTF chart however it seems to run properly when I run it on the highest timeframe chart. I need the EA to run on the smaller timeframes but it only seemes to be able to allocate a certain number of bars to the history cache for the higher timeframe candles(according to my console/journal). Please how do I fix this.
hello guys. So I was trying to build an EA that utilises bars of multiple timeframes to gather information for trading. Now i'm struggling with an issue where if I try to run the code on a lower timeframe chart it can't seem to access the adequate number of bars it needs on the higher timeframe charts. This causes my EA to crash with an array out of range error whenever I run it a LTF chart however it seems to run properly when I run it on the highest timeframe chart. I need the EA to run on the smaller timeframes but it only seemes to be able to allocate a certain number of bars to the history cache for the higher timeframe candles(according to my console/journal). Please how do I fix this.
I suggest you include more error handling into your code.
Documentation states how Copy xxx behaves in an EA, and you need to take this into account in your code.
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