Rank: Advanced Member
Groups: Registered, Registered Users Joined: 10/6/2005(UTC) Posts: 51
|
Im trying to use the following for the bear market indicator in an expert, using weekly charts. It keeps getting error messages because of periods out of range. I tried using the cum() function and cant get it to work. So it stops on most charts flagging the error.
The formula is below, and the issue is that it contains moving average of 70-100 weeks and some of the charts have less data that that.
Appreciate anyone who can help get it to work without the message.
Formula is this:
( Fml( "zCRSIGrowthxxLong") <0 OR Mov( Fml( "zCRSIGrowthxxLong"),8,E)<Mov( Fml( "zCRSIGrowthxxLong"),21,E) OR CLOSE<LinearReg(CLOSE,100) )
zCRSIGrowthxxLong embedded in the above is a custom formula defined as:
Mov( CLOSE,70,E)/Ref(Mov(CLOSE,100,E),-10)- Mov( Security("c:\MetaStock Data\Indices & Indicators\US & Canadian Indices\.SPQ",CLOSE) ,70,E)/Ref( Mov( Security("c:\MetaStock Data\Indices & Indicators\US & Canadian Indices\.SPQ",CLOSE) ,100,E),-10)
Appreciate your help- I hope that future versions will have the option to invalidate error messages without eliminating automatically the expert from the chart.
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
You can use the Forum.dll moving average function to sort out the mov() function limitations, but you are still going to have to deal with the linreg limitation...
either use another forum.mov() function in lieu of the linreg, or drop the linreg requirement altogether, or write another code for the variable period least suqares regression.
Hope this helps.
wabbit [:D]
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 10/6/2005(UTC) Posts: 51
|
Thanks mate-appreciate your advice-
I hope the next version simply leaves the indicator there but blank instead of removing it from the chart so it doesnt need to be reloaded after every failure-
Ill try to do the forum dll coding etc! Appreciate your advice as always
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.