How to fix Stack Overflow?

Post Reply
ericjschroeder
Trader
Posts: 52
Joined: Sat Jan 05, 2013 2:50 am

How to fix Stack Overflow?

Post by ericjschroeder »

I have a 6000 line indicator I've been working on for a while and lately I get a Stack Overflow, but ONLY when the broker's new day starts (or ends?)! I know there is usually a pause in the data feed for a short time at that point. It's fine the rest of the time but when the day changes, I get the error in the Experts tab and it does not update until I recompile. I'm curious what to look for to fix this problem. I have searched Google but have not found anything that would clearly help. Any ideas appreciated.
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

How to fix Stack Overflow?

Post by milanese »

ericjschroeder » Sat Nov 05, 2016 11:13 pm wrote:I have a 6000 line indicator I've been working on for a while and lately I get a Stack Overflow, but ONLY when the broker's new day starts (or ends?)! I know there is usually a pause in the data feed for a short time at that point. It's fine the rest of the time but when the day changes, I get the error in the Experts tab and it does not update until I recompile. I'm curious what to look for to fix this problem. I have searched Google but have not found anything that would clearly help. Any ideas appreciated.
Without knowing your indicator it is not possible to say what is happening, best what be to share it, than could someone probably help you..
First thing you could do for avoid this as general advice is to limit the bars the indicator works..
Than control if you are using always that right variable type(at exp int and not double where int is supposed).

Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
ericjschroeder
Trader
Posts: 52
Joined: Sat Jan 05, 2013 2:50 am

How to fix Stack Overflow?

Post by ericjschroeder »

Thanks, I have done some code modification and waiting to see if that fixed it. Sorry, that I can't post the indicator at this time, but it's frustrating that I can't find any documentation from Empty4/MQL telling me what causes that error and what to look for to fix it. Most of the results I found on Google said their program wouldn't even run but mine works fine and just recently started having that error, but only at the day change time, which is weird. Thanks
MathiasJ
Trader
Posts: 146
Joined: Thu Mar 17, 2016 9:39 pm
Location: Sweden

How to fix Stack Overflow?

Post by MathiasJ »

You can actually increase static memory with a directive but the problem is probably that you store too much in variables reciding on the stack, including bars on chart.

I try not to use too many normal arrays but more structs or classes and then arrays of pointers to those. I think that made a difference.

Good luck in your investigation.
Post Reply

Return to “Coders Hangout”