Topic: Error with Opening Logic Condition

Dear all,

First of all thanks for a great program. I have been using it for a while and very amazed with all the possibilities it has. I have encountered an error when I try to add the Accelerator Oscillator as an opening logic. I am not sure if it is an error with FSB or with my operating system. The error I get it as follows. When I have set the parameters of the indicator and click Accept to include it I receive this message ( Its a bit long but here it goes):

"Se slutningen af denne meddelelse, hvis du vil have detaljer om,
hvordan du starter JIT-fejlfinding i stedet for denne dialogboks.

************** Undtagelsestekst **************
System.IndexOutOfRangeException: Indekset lå uden for arrayets grænser.
   ved Forex_Strategy_Builder.Small_Indicator_Chart.SetUpChart()
   ved Forex_Strategy_Builder.Small_Indicator_Chart.InitChart()
   ved Forex_Strategy_Builder.Actions.EditSlot(Int32 slot)
   ved System.Windows.Forms.Control.OnClick(EventArgs e)
...

[Edited by Admin]
           Part of the report was deleted except the first lines. (Only first few lines are informative.)

Does anyone know what it can be?

Thanks in advance.
/Itai

Re: Error with Opening Logic Condition

I have experienced similar if I have been running my system for quite a while without a reboot.

My thinking has been that the memory in my system gets messed up after running several instances of the generator for a few days and finally the program aborts.

That may not be the case in your situation, however, perhaps you will be able to determine if the instance occurs after a clean reboot or after you have been using FST for many hours

3 (edited by Itai 2011-09-15 14:18:50)

Re: Error with Opening Logic Condition

I thought it could be something like that so I rebooted the computer but got the same error. Then I tried on another computer and received the same error (This time the operating system is in english so the error is also in english :-) :

"Index was outside the bounds of the array."

The funny thing is that when I can include this opening logic in the forex startegy trader without getting any error. But when I then save it in FST and tries to open it in the FSB I receive the error.

See screenshot below for the error I receive in FSB:

http://s2.postimage.org/172xqwp2c/FSB_error.jpg

Re: Error with Opening Logic Condition

Can you please describe the exact steps that lead to the crash. If I reproduce it, I'll be able to fix it easily.

Thank you.

Re: Error with Opening Logic Condition

That would be great.
In the strategy, beside the Opening and Closing Point of the Position, there are 7 Opening Logic Conditions and 8 Closing logic Conditions with the use of logical groups. When I added the 8th Opening Logic Condition to the strategy I received the error. I think there were too many logic conditions in the open and close logic conditions that overloaded the system.
This is only when I use the FSB. With the FST I did not get the error.
If I could upload a file here I could upload a test strategy where I receive the error, or I could send you a mail with this test strategy.

If you need more info please let me know.
Have a great weekend!

Re: Error with Opening Logic Condition

You can attach the strategy to the forum. Use "Post Replay" link to open full reply form and you'll see file attach buttons.

Re: Error with Opening Logic Condition

I have created this test strategy. When I open it I get the error. I have tried to open it on two machines. One with windows XP and the other one with Windows 7. Both return with the error. If you don't get the error try to add another open filter.
It would be interesting to know if you also get the same error.

Post's attachments

TEST ERROR.xml 16.31 kb, 3 downloads since 2011-09-16 

You don't have the permssions to download the attachments of this post.

Re: Error with Opening Logic Condition

I see now. There is a limit that allows for a strategy maximum 12 indicators plotted on separated charts. This limit is hard coded in the program. I'll correct this in next versions.

In order to prevent further crashes, please limit the strategy to 12 indicators.

Thank you for the report!

9 (edited by krog 2011-09-16 21:37:39)

Re: Error with Opening Logic Condition

I've reproduced by adding 8 open filters then 8 close filters to a New strategy. I think it's:

Small Indicator Chart.SetUpChart: line 195

because Itai's separated chart indicators exceed 12.
Can the array size be increased or made dynamic? Usually I can do that in other languages, but haven't found how to do it in C#.

EDIT >> Mr Popov beat me to the solution ...

Re: Error with Opening Logic Condition

Can the array size be increased or made dynamic? Usually I can do that in other languages, but haven't found how to do it in C#.

We can use some sort of List for dynamical resizing, but it has some drawbacks.
I'll make it:

aiIndSlot  = new int[Configs.MAX_ENTRY_FILTERS + Configs.MAX_EXIT_FILTERS + 2];

for next versions.

Re: Error with Opening Logic Condition

It seams that:

aiIndSlot  = new int[Configs.MAX_ENTRY_FILTERS + Configs.MAX_EXIT_FILTERS + 2];

is not enough.

We can also correct  Configs.MAX_ENTRY_FILTERS and Configs.MAX_EXIT_FILTERS according to the startegy.

I added also:

                    if (Data.Strategy.OpenFilters > Configs.MAX_ENTRY_FILTERS)
                        Configs.MAX_ENTRY_FILTERS = Data.Strategy.OpenFilters;
                    if (Data.Strategy.CloseFilters > Configs.MAX_EXIT_FILTERS)
                        Configs.MAX_EXIT_FILTERS = Data.Strategy.CloseFilters;

in OpenStrategy function. File Actions.cs line 723.

Now the strategy is properly loaded.

http://s3.postimage.org/19leg1uo4/9_16_2011_11_57_31_PM.jpg

[Edit]
Diff at github.com: Corrected crash when strategy has more than 12 indicators with separated charts.