logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
StorkBite  
#1 Posted : Monday, July 31, 2006 11:15:58 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 13 time(s) in 10 post(s)

How to eliminate error messages in the Expert Advisor

I have a 200-day EMA commentary in the Expert Advisor. The security that I loaded contains less than 200 bars of data. It results in this error message: *Error* Function did not return a value. How do I eliminate this error message?

writeif(lastvalue(cum(1))>200,"The 200 day EMA is at writeval(mov(c,200,e))","")

The code uses the writeif() function to check the condition of lastvalue(cum(1))>200 which counts the number of bars in the open chart. If the last value of this is greater than 200 then there must be more than 200 bars of data in the chart. This makes the expression TRUE and the statement is printed to the screen with the value of the 200 day EMA. If there is less than 200 bars in the chart the output is nothing.

thanks 1 user thanked StorkBite for this useful post.
Meta8512 on 3/11/2017(UTC)
wicky  
#2 Posted : Friday, November 14, 2014 9:24:50 AM(UTC)
wicky

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 11/14/2014(UTC)
Posts: 1

This makes the expression TRUE and the statement is printed to the screen with the value of the 200 day EMA. If there is less than 200 bars in the chart the output is nothing. __________________________ dhoom
Users browsing this topic
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.