Invalid Pointers Access Help!

 

Hi community,

I'm so new to all this so please bare with me...

long story short I've got pointer access issues. I'm using Creating Multi-Expert Advisors on the basis of Trading Models - MQL5 Articles as my start point to which I've made little adjustments.

I get this when trying to run my code, which I will provide. The Bot used to run but now at runtime i get this error.

2021.12.11 14:01:51.967 ModelTest2 (AU200,H1) Load indicators...

2021.12.11 14:01:51.967 ModelTest2 (AU200,H1) cannot load indicator 'Moving Average' [4302]

2021.12.11 14:01:51.967 ModelTest2 (AU200,H1) Error creating MACD indicator

2021.12.11 14:14:13.047 ModelTest2 (XAGUSD.s,M5) Load indicators...

2021.12.11 14:14:13.047 ModelTest2 (XAGUSD.s,M5) cannot load indicator 'Moving Average' [4302]

2021.12.11 14:14:13.047 ModelTest2 (XAGUSD.s,M5) Error creating MACD indicator

2021.12.11 14:14:13.047 ModelTest2 (XAGUSD.s,M5) invalid pointer access in 'ModelTest2.mq5' (112,30)

I'm also pretty sure that the virtual orders don't get added...

bool CModel::Add(ulong Ticket,double stop_loss,double take_profit)
  {
   CTableOrders *t=new CTableOrders;
   if(!t.Add(Ticket,stop_loss,take_profit))
     {
      Print("The order addition has failed. Check order parameters.");
      return(false);
     }
   if(ListTableOrders.Add((t))==-1)
     {
      Print("Can't add order to the orders table. Error!");
      return(false);
     }
   Print("Order ",Ticket," has been added successfully");
   return(true);
Someone please help! 

Update!
Fix first issue, it had to do with symbol suffix for broker I which to having not realized it!

Second isssue still persists… During runtime only the last print statement outputs indicating that in theory something did get added to the list. But elsewhere in the EAs work it doesn’t see it!
Creating Multi-Expert Advisors on the basis of Trading Models
Creating Multi-Expert Advisors on the basis of Trading Models
  • www.mql5.com
Using the object-oriented approach in MQL5 greatly simplifies the creation of multi-currency/multi-system /multi-time-frame Expert Advisors. Just imagine, your single EA trades on several dozens of trading strategies, on all of the available instruments, and on all of the possible time frames! In addition, the EA is easily tested in the tester, and for all of the strategies, included in its composition, it has one or several working systems of money management.
Files:
Model.mqh  23 kb
model_ma.mqh  13 kb
mm.mqh  7 kb
model_macd.mqh  12 kb
 
Try reading the log. It states the problem.
 
Dominik Egert #:
Try reading the log. It states the problem.
Elsewhere in model_ma it’s supposed to print the list.total() but prints 0
 
Maybe you begin with this:

 cannot load indicator 'Moving Average' [4302]
 
Dominik Egert #:
Maybe you begin with this:

 cannot load indicator 'Moving Average' [4302]
Solved that by adding all symbols to watchlist… total elements still outputs 0
 
Cutey Pie #:
Solved that by adding all symbols to watchlist… total elements still outputs 0
https://www.mql5.com/en/articles/654
Debugging MQL5 Programs
Debugging MQL5 Programs
  • www.mql5.com
This article is intended primarily for the programmers who have already learned the language but have not fully mastered the program development yet. It reveals some debugging techniques and presents a combined experience of the author and many other programmers.
 
Thank you, I knew this one would come… 
I think my problem is understanding the all object and pointers thing…!
Reason: