1 (edited by dr.B 2012-03-01 10:09:50)

Topic: Hi I am getting an Unhandled Exception Error Help Please

hi
I am trying to modify the Envelopes indicator.  I have added  a second MA. I used the  two MA's to create a price range ( High and Low).  Subsequently I replaced the current envelope by a new one, formed by  adding to top and subtracting from bottom  the  % deviation from current range ( range formed by the two MA's).  I basically ended up with a new envelope.  The FSB accepted it fine, but when I try to sue it in the strategy, I now get an 'Unhandled Exception Error' !! I have no idea how to deal with sad  Please Help !
Thanks
ps
Wow who new that writing a computer code can be so frustrating lol  smile

Post's attachments

Dr.B Double MA Envelopes V1.cs 30.31 kb, 19 downloads since 2012-03-01 

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

Re: Hi I am getting an Unhandled Exception Error Help Please

Hi Dr.B,
Totally agree, so frustrating. I'm just learning but from a quick glance you have the following set expecting 6 components when there are only 5.
// Saving the components
            Component = new IndicatorComp[6];
Tested OK with the "Check the Custom Indicators" option and with the following but haven't tested it fully at all settings:
// Saving the components
            Component = new IndicatorComp[5];
Hope that's the answer
Mick

Re: Hi I am getting an Unhandled Exception Error Help Please

Thanks for your reply,
however that was the part of the original programming and changing that made no difference sad


Jagmanmick wrote:

Hi Dr.B,
Totally agree, so frustrating. I'm just learning but from a quick glance you have the following set expecting 6 components when there are only 5.
// Saving the components
            Component = new IndicatorComp[6];
Tested OK with the "Check the Custom Indicators" option and with the following but haven't tested it fully at all settings:
// Saving the components
            Component = new IndicatorComp[5];
Hope that's the answer
Mick

Re: Hi I am getting an Unhandled Exception Error Help Please

It works on my end... However, I made few changes:

Line 172 - shift value not correct;
176,177 - price not defined correctly (don't ask my why, I can't explain big_smile ).

double[] adMAFir = MovingAverage(iNFirMA, iSFirMA, FirMAMethod, High);
          double[] adMASec = MovingAverage(iNSecMA, iSSecMA, SecMAMethod, Low);

Define price some other way, you'll have baseprice option working.

Re: Hi I am getting an Unhandled Exception Error Help Please

double[] adMAFir = MovingAverage(iNFirMA, iSFirMA, FirMAMethod, Price(FirPrice));
            double[] adMASec = MovingAverage(iNSecMA, iSSecMA, SecMAMethod, Price(SecPrice));

This works.

Re: Hi I am getting an Unhandled Exception Error Help Please

footon wrote:
double[] adMAFir = MovingAverage(iNFirMA, iSFirMA, FirMAMethod, Price(FirPrice));
            double[] adMASec = MovingAverage(iNSecMA, iSSecMA, SecMAMethod, Price(SecPrice));

This works.


well don't know what happened, i restarted FSB  and it seems to work now
thanks guys for helping... don't yet know if its accurate but  enjoy  the indicator.  if you find a good combo please share  smile