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

Notification

Icon
Error

Options
Go to last post Go to first unread
kaushik1  
#1 Posted : Sunday, January 29, 2017 4:56:30 PM(UTC)
kaushik1

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/11/2012(UTC)
Posts: 45

Dear All Expert,

I need your Help to Find a valid formula for expert advisor..
I am correctly following four types of component for trade signal.1) Enter a Long 2) Exit a Long 3) Enter a short and 4) Exit a Short...

Enter a Long

 

Cross(mov(C,3,s),mov(C,8,s) and

PDI(5) > MDI(5) and

ADX(5) > 16

 

All the Buy Signal are generated only if above all the Criteria has been match..

 

Long Exit

Cross(mov(C,8,s),mov(C,3,s))

 

 Now, When I enter this formula, it saws me all the Signal whenever 3 SMA cross below 8 SMA…

 

 I want a sell signal only which followed by my “Enter a Long “ Signal generated…..

 

 Kindly help me for Coding


Edited by user Monday, January 30, 2017 7:26:36 AM(UTC)  | Reason: Not specified

wabbit  
#2 Posted : Monday, January 30, 2017 12:26:05 AM(UTC)
wabbit

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)
kaushik1  
#3 Posted : Monday, January 30, 2017 6:32:04 AM(UTC)
kaushik1

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/11/2012(UTC)
Posts: 45

Thank you... but please help me to code this exit formula with respect of my Buy condition given.. PLease
wabbit  
#4 Posted : Monday, January 30, 2017 7:55:02 AM(UTC)
wabbit

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)
If you're going to latch four signals, Long Entry, Long Exit, Short Entry and Short Exit, use the latch function in the Forum DLL, which is freely available to download from the files section of the forum.
kaushik1  
#5 Posted : Monday, January 30, 2017 3:48:19 PM(UTC)
kaushik1

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/11/2012(UTC)
Posts: 45

Still not able to understand.... I would be more thankful to you if you help me how to starts coding this using latch function... please
wabbit  
#6 Posted : Monday, January 30, 2017 11:35:33 PM(UTC)
wabbit

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)
Have you downloaded and installed the forum.dll? Have you read the accompanying documentation for the latch function?
kaushik1  
#7 Posted : Tuesday, January 31, 2017 2:45:56 AM(UTC)
kaushik1

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/11/2012(UTC)
Posts: 45

I have Download the Forum.DLL... but Didnt find a Documentation for the Latch function... please provide or suggest Link to download....
wabbit  
#8 Posted : Tuesday, January 31, 2017 2:52:57 AM(UTC)
wabbit

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)
kaushik1  
#9 Posted : Wednesday, February 1, 2017 3:03:14 AM(UTC)
kaushik1

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/11/2012(UTC)
Posts: 45

Hello, I had input my formula as per the instruction given in manual... in case of Long Entry signal, it result is saw in Expert Advisor Symbol area..given below MY Long Entry Signal LE:=Cross(Mov(C,3,E),Mov(C,7,E)); LX:=Cross(Mov(C,7,E),Mov(C,3,E)); SE:=Cross(Mov(C,7,E),Mov(C,3,E)); SX:=Cross(Mov(C,3,E),Mov(C,7,E)); B:= ExtFml("Forum20.Latch",LE,LX,SE,SX); B = 1 AND Ref(B,-1) <> 1 In case Long Exit, it is not sawing any result .. MY Long Exit Signal LE:=Cross(Mov(C,3,E),Mov(C,7,E)); LX:=Cross(Mov(C,7,E),Mov(C,3,E)); SE:=Cross(Mov(C,7,E),Mov(C,3,E)); SX:=Cross(Mov(C,3,E),Mov(C,7,E)); B:= ExtFml("Forum20.Latch",LE,LX,SE,SX); B = 0 AND Ref(B,-1) = 1 Kindly Help to below formula is perfect or Not... Thank you...
wabbit  
#10 Posted : Wednesday, February 1, 2017 3:43:05 AM(UTC)
wabbit

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)
Try this:- MY Long Entry Signal
Code:

LE:=Cross(Mov(C,3,E),Mov(C,7,E));
LX:=Cross(Mov(C,7,E),Mov(C,3,E));
B:= ExtFml("Forum20.Latch",LE,LX,0,0);
B = 1 AND Ref(B,-1) <> 1


MY Long Exit Signal

LE:=Cross(Mov(C,3,E),Mov(C,7,E));
LX:=Cross(Mov(C,7,E),Mov(C,3,E));
B:= ExtFml("Forum20.Latch",LE,LX,0,0);
B = 0 AND Ref(B,-1) = 1;

Edited by user Thursday, April 20, 2017 11:50:55 AM(UTC)  | Reason: Fixed code tags

kaushik1  
#11 Posted : Thursday, February 2, 2017 2:49:26 PM(UTC)
kaushik1

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/11/2012(UTC)
Posts: 45

Thank you Bro.. it works fine and as per the my Expectation... now please suggest how can i put this in Expert Aadvisor > Highlight option... I am looking for whole open call looks in Green Highlight
wabbit  
#12 Posted : Friday, February 3, 2017 12:17:10 AM(UTC)
wabbit

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)
Long trade highlight
Code:

LE:=Cross(Mov(C,3,E),Mov(C,7,E));
LX:=Cross(Mov(C,7,E),Mov(C,3,E));
ExtFml("Forum20.Latch",LE,LX,0,0) = 1;

Edited by user Thursday, April 20, 2017 11:51:44 AM(UTC)  | Reason: Fixed code tags

kaushik1  
#13 Posted : Saturday, February 4, 2017 4:09:59 AM(UTC)
kaushik1

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/11/2012(UTC)
Posts: 45

Fantastic work... I had applied and it has work same according... Thank you soo Much for your Kind Help.. Now seeking for your Help one more step ahead.... same way I am Seeking for Sell Side.. I had tried from my way but not able to place it in proper way.... Kindly Help MY Short Entry Signal LE:=Cross(Mov(C,3,E),Mov(C,7,E)); LX:=Cross(Mov(C,7,E),Mov(C,3,E)); SE:=Cross(Mov(C,7,E),Mov(C,3,E)); SX:=Cross(Mov(C,3,E),Mov(C,7,E)); B:= ExtFml("Forum20.Latch",LE,LX,SE,SX); B ________________________ MY Short Exit Signal LE:=Cross(Mov(C,3,E),Mov(C,7,E)); LX:=Cross(Mov(C,7,E),Mov(C,3,E)); SE:=Cross(Mov(C,7,E),Mov(C,3,E)); SX:=Cross(Mov(C,3,E),Mov(C,7,E)); B:= ExtFml("Forum20.Latch",LE,LX,SE,SX); B___________________________ please help me to fill The Blank. Also Want to Short Trade Highlinght According the above formula... Thank you So Much in Advance....
wabbit  
#14 Posted : Sunday, February 5, 2017 2:55:34 AM(UTC)
wabbit

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)
If you're going to be swing trading where you're always in a trade, where the long exit is a signal for a short entry, and a short exit is a signal to trade long, then you don't need to code the SE and SX portions of the latch, because either you're long or you're not (and that means you're short). Long trade highlight
Code:

LE:=Cross(Mov(C,3,E),Mov(C,7,E));
LX:=Cross(Mov(C,7,E),Mov(C,3,E));
ExtFml("Forum20.Latch",LE,LX,0,0) = 1;
Short trade highlight
Code:

LE:=Cross(Mov(C,3,E),Mov(C,7,E));
LX:=Cross(Mov(C,7,E),Mov(C,3,E));
ExtFml("Forum20.Latch",LE,LX,0,0) = 0;
The latch function doesn't allow for swing trading; some years ago I posted a truth table for the latch, you can find it using the search functionality if you're interested.

Edited by user Thursday, April 20, 2017 11:53:03 AM(UTC)  | Reason: Fixed code tags

kaushik1  
#15 Posted : Sunday, February 5, 2017 1:15:29 PM(UTC)
kaushik1

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/11/2012(UTC)
Posts: 45

thank you sooo.much.... i truely understand what you want to tell about... actually i have some "and" or "or" function.... so thank you for your kind help
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.