stack overflow
-
Hi,
First, thank you for such a great program! I am trying to create a customized grid, however, I keep getting a stack overflow. It will generally work for a few trades, and then I get the error. I can't use a pending order grid because I am going to be adding custom code once I get the preliminary EA working. The way I have the program setup, I calculate the distance that I want, and place the result in a variable. I then check to see if the current price is equal to any of the grid levels. Once I close all of the trades, I reset the values back to their original values. Also, occasionally, the grid level does get executed at the correct time. I have attached a screenshot, and you can see the distance between trade 29 & 30 is 20 pips, when it should be 10. The EA is called newgridimproved2, in case you need to load it. Any help is greatly appreciated! Keep up the great work!Thank you,
Beau......
newgrid.png -
It's not a good idea to compare two prices with "==". You know the price is always moving up and down, but there is no guarantee that the price will reach exactly 1.23456 level (for example), it can be 1.23455 at certain moment and then jump to 1.23457. So, always use "<", ">", "<=" or ">=" when working with prices.
Isn't it easier to use the special grid blocks? "Buy pending orders in grid" and "Sell pending orders in grid". At least it's much easier to build the project and put it to work. And some day, I don't know when, I may create the ability to put virtual pending orders...
For the Stack overflow error... this error always confuses me, but I know for example that it can appear if you have an infinite loop somewhere in the code, for example if you connect the output of one block to it's input... but I can't see things like this in this project

-
By the way, when you connect multiple blocks in parallel, like your conditions, note that they all be executed one after another depending on their id numbers. You can use the yellow output to connect them in something like serial connection.... like this: http://fxdreema.com/demo/applying-or-logic-method1
-
Aha! See block 21, it's self-connected.
-
fxDreema,
Thank you for such a quick reply!!! This has been plaguing me for a week now, great eyes! I would love to use the built-in grid, but I plan on calculating a dynamic lot size for each level. I will fix the ==, but for testing it, this was the easiest approach.Thank you again,
Beau