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

Notification

Icon
Error

Options
Go to last post Go to first unread
stinkray  
#1 Posted : Thursday, September 5, 2013 7:58:40 AM(UTC)
stinkray

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/4/2012(UTC)
Posts: 12

Thanks: 4 times
I created an EA. However the trigger on the day chart after applying EA need to be adjusted one day earlier to reflect what I needed . How do I code that under :condition?

Appreciate if somebody could help
henry1224  
#2 Posted : Thursday, September 5, 2013 1:58:44 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Please post the code of this expert! I'm not about to guess what you are looking for!
retireewill  
#3 Posted : Thursday, September 12, 2013 2:44:59 PM(UTC)
retireewill

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 5/1/2012(UTC)
Posts: 25
Location: Sherman, Texas

Is this what you are looking for? Something that gives a Signal one bar before execution?
(http://tempuri.org/tempuri.html) - Link invalid - outdated.

The Ribbon has info, but only at the point in time that the parameters are met. The EA gives signal one day ahead of time.
henry1224  
#4 Posted : Tuesday, September 17, 2013 12:05:11 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Actually, The expert advisor has the ability to show at least 3 different systems on the same chart!

In the ribbon, you can show long, short, and neutral positions from system1.
In the Highlights , you can also show long, short ,and neutral positions from system2.
in the symbol ,you can show individual symbols and events occuring on the bar of the actual event from system3.
If you really want to you could set a 4th system just using the alerts, but they would not show up as signals on the chart.

It's all in the way you write your systems!In both the highlights and symbol tabs, you have to be aware of the precedence of your signal, the higher the priority the first to fire!
stinkray  
#5 Posted : Saturday, September 21, 2013 6:43:43 AM(UTC)
stinkray

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/4/2012(UTC)
Posts: 12

Thanks: 4 times
After applying my EA, the expert symbol will appear on one of the day candles. However I need to push this symbol back one day. Tried Ref(EA formula,-1) but did not work. Any suggestions? Thank you all
henry1224  
#6 Posted : Saturday, September 21, 2013 7:04:58 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
If you use a system that is +1 for long,-1 for short and 0 for neutral,The signal bar of the actual event would be sig=1 and Ref(Sig,-1)<>1 any earlier ref function would show up as 0 because the event has not yet happened.
stinkray  
#7 Posted : Saturday, September 21, 2013 8:49:54 AM(UTC)
stinkray

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/4/2012(UTC)
Posts: 12

Thanks: 4 times

Hi Henry

Thanks for your help. My EA code is:

Ref( Fml( "ABC"),-2)<Ref( Fml( "ABC"),-1) AND (Ref( Fml( "ABC"),-1)>

Fml( " ABC ") ) AND Ref(Fml( " ABC "),-2)>0 AND Ref(Fml( " ABC "),-1)>0

AND Fml( " ABC ")>0

Need to push the Expert Symbol backward one day. Any ideas? Thanks again

henry1224  
#8 Posted : Saturday, September 21, 2013 10:25:33 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
A system signal should be a binary output IE:=+1,-1,0.

There are several ways to do this

Long:=C>Mov(C,50,S);
Short:=C<Mov(C,50,S);
Signal:=Long-short;
Signal
________
_____ / \_______
\____/
This creates a true ,false binary system
if the long condition is true it gives a +1 and the short condition gives a 0 so with that said the signal line will be 1-0=1 as long as the conditions remain the same.

if the short condition becomes true it will give +1 and the long condition gives a 0 so with that the signal line will be 0-1=-1

so a long buy signal for the first bar event would be Signal=1 and Ref(Signal,-1)<>1
a short sell signal for the first bar event would be Signal=-1 and Ref(Signal,-1)<>-1
A long exit signal would be Signal<>1 and Ref(Signal,-1)=1
A short exit signal would be Signal<>-1 and Ref(Signal,-1)=-1

If you were to use the forum dll in your systems it would be the same

retireewill  
#9 Posted : Saturday, September 21, 2013 11:00:12 AM(UTC)
retireewill

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 5/1/2012(UTC)
Posts: 25
Location: Sherman, Texas

{I use this formula for one of my issues in the Symbols section, not trend. Trend would have the "-2", "-1" in formula as usual.}
{BUY Condition}
BC:=Ref( Stoch(?,?), -1) < ?? AND Stoch(?,?) > ??

OR
{This statement used to catch Oversold condition}
Ref(Stoch(?,?),-1) < ?? AND Stoch(?,?) > ??;

{Sell Condition - I don't use a secondary Exit parameter - when they start selling it is often a panic, thus TWO Stochs, one for IN, one for Panic:-)}
SC:=Ref( Stoch(?,?), -2) > ?? AND Ref(Stoch(?,?),-1) < ??;

{EA Signal plotted one day before trade - trade at Open next day}
Trade:=If(BC,1,If(SC,0,PREV));
Cross(Trade,0.1)
---------------
In your case I would take one statement at a time, and comment out following Statements. See if that one statement is giving you anything close to what you are looking for. At least, if it doesn't barf, then add another statement, etc.
stinkray  
#10 Posted : Tuesday, September 24, 2013 11:58:19 PM(UTC)
stinkray

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 9/4/2012(UTC)
Posts: 12

Thanks: 4 times
I need some help to find out how many days a stock closed above 20 SMA. How do I code it in Metastock Explorer? Thank you
Users browsing this topic
Similar Topics
Simbols in the EXPERT ADVISOR (Formula Assistance)
by corrado 10/31/2020 2:12:10 PM(UTC)
How do I enter a custom formula into the Expert Advisor? (Custom Formulas)
by MS Support 5/8/2017 4:12:57 PM(UTC)
Translate an Expert Advisor formula to the indicator builder (Formula Assistance)
by Borsatrader 11/27/2016 6:15:31 PM(UTC)
Expert Advisor : Exporting Alert messages to a plain-text file (MetaStock)
by xrousaios 5/19/2015 4:07:02 PM(UTC)
Weekly Expert Advisor Ribbon on Daily Chart (Formula Assistance)
by Andrew7267 4/18/2015 1:52:16 PM(UTC)
About Symbols in Expert Advisor (Advanced Coding Techniques)
by htt1203dms 3/21/2015 2:56:31 PM(UTC)
Expert Advisor: Setting 1 condition (Formula Assistance)
by johngoat 12/22/2014 12:51:34 AM(UTC)
Pyramid expert advisor (Advanced Coding Techniques)
by Steve W 3/26/2014 3:51:53 AM(UTC)
Expert Advisors (MetaStock)
by xrousaios 2/23/2014 10:40:38 AM(UTC)
I also have a problem on the buy and sell of alerts of expert advisor (Formula Assistance)
by Frenkys 1/1/2014 2:29:47 PM(UTC)
Please Help me ! for ATR trailing stop in indicator builder convert for expert advisor or system tester (Formula Assistance)
by petouchbaby 3/13/2013 2:28:34 AM(UTC)
How to use a variable in Expert Advisor Commentary (Basic Coding Techniques)
by epraveen 10/5/2012 6:40:36 AM(UTC)
Best Expert advisor (MetaStock)
by nisshenvj 8/20/2012 9:07:07 AM(UTC)
Bollinger in expert advisor (Formula Assistance)
by Precisely 4/20/2012 12:27:28 PM(UTC)
automatic alert for stocks/scripts on expert advisor? (MetaStock)
by somee 2/23/2012 12:58:42 AM(UTC)
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.