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

Notification

Icon
Error

Options
Go to last post Go to first unread
htt1203dms  
#1 Posted : Saturday, March 21, 2015 2:56:31 PM(UTC)
htt1203dms

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 3/21/2015(UTC)
Posts: 2

Thanks: 2 times

Hi everyone,

Im newbie in Forum, please help me with my coding.

I just finished my EA, but they appear to have so many unnecessary symbols.

How can I remove them and leave just 1?

For example, If Symbol A appear, another will not show up until a Symbol B does.

Thanks for your help.

Grateful

 

mstt  
#2 Posted : Saturday, March 21, 2015 6:24:26 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi htt It appears that your expert signal is remaining TRUE for extended periods. The solution is to truncate your signal to just one bar (i.e. only the first bar that the signal is TRUE). Let's suppose that the name of your expert signal is "Result". Rather than use... Result; ... as the output of your expert you can truncate this very easily as shown by the following two examples. Result AND Ref(Result,-1)=FALSE; ... or perhaps a shorter piece of code doing exactly the job.... Result*Alert(Result=0,2); Roy
thanks 1 user thanked mstt for this useful post.
htt1203dms on 3/21/2015(UTC)
mstt  
#3 Posted : Saturday, March 21, 2015 6:48:30 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
I'm assuming that your result or output generates either a TRUE or a FALSE, so here are a couple of other truncation methods, that should do the trick. Cross(Result,0.5); Result > Ref(Result,-1); Roy
thanks 1 user thanked mstt for this useful post.
htt1203dms on 3/21/2015(UTC)
htt1203dms  
#4 Posted : Saturday, March 21, 2015 10:42:20 PM(UTC)
htt1203dms

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 3/21/2015(UTC)
Posts: 2

Thanks: 2 times
Thank you very much Mr.mstt Unfortunately, I cant use this in my code. If I call it 1 for TRUE, and 0 for WRONG, the chart appear: 0 1 1 0 0 0 1 0 1 0 0 1. So Result AND Ref(Result,-1)=FALSE; OR Cross(Result,0.5); Result > Ref(Result,-1); just work in some case like 0 1 1 0, but stay wrong most of the time. Im thinking about some stuff like: 0 1 0 0 0 0 0 0 0 0 0 0 0. Im still working with this, but very grateful if you give me some hint. Thank you very much
mstt  
#5 Posted : Saturday, March 21, 2015 11:03:27 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Supply the code that you have already created for just one symbol and I'll see if I can help sort that out. Hopefully you'll then be able to adapt any remaining symbol code to work the same way. Without actual code it's difficult to recreate your problem, and therefore not always the easiest problem to fix. Words can mean different things to different people but MetaStock code will generally work the same everywhere (as long as code for any external inputs is included). Roy
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.