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

Notification

Icon
Error

Options
Go to last post Go to first unread
swordman  
#1 Posted : Friday, April 28, 2006 8:29:56 AM(UTC)
swordman

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/10/2006(UTC)
Posts: 42
Location: Hong Kong

How can it be done ? For example , after the position closed , I dont want to enter a new position again within the next X days . I found it hard to do so as sometimes the exit was done by a trailing stop/profit target . For example , for testing a system day bar for futures , when I closed a position at the last several days of a month and I don't want to open a new position again within the same month . It seems hard to do it by the valuewhen function . thanks for the helper in advance .
wabbit  
#2 Posted : Friday, April 28, 2006 10:54:13 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)
Read through the codes found in this thread..... http://forum.equis.com/viewtopic.php?t=3775 wabbit :D
swordman  
#3 Posted : Friday, April 28, 2006 1:59:54 PM(UTC)
swordman

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/10/2006(UTC)
Posts: 42
Location: Hong Kong

oh , it is you again . Many many thanks , Wabbit , but my version seem can't work with that file . I have paid to upgrade . Wish I can get it next week and try . I suppose it maybe solved by formula language . I wish there will be some command function like 'entrybar ' , 'exitbar' , something like that. Thanks for helping again . :)
wabbit  
#4 Posted : Friday, April 28, 2006 2:21:21 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)
If my memory serves me correctly, then ExtFml function calls were introduced in MS7.0??? Which means, you should be able to use the Forum Latch functions?? When you say, "It doesn't work", what exactly do you mean? Have you copied the Forum2.dll file from the downloads section into your <path to MetaStock>\\External Function DLLs\\ folder? Did you completely shutdown MS and restart it? Please tell us exactly, what you have done to try to use these functions. I believe you have everything you need, but have made a simple mistake somewhere. If you use SkyPE for VoIP (over a broadband connection) give me a call (as "treatmentplant") or send me another email and we can go over your problems offline. SkyPE is the preferred method! wabbit :D
Jose  
#5 Posted : Friday, April 28, 2006 3:02:02 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Try this indicator code: [code:1:ae0d470eee] ============================ Exit-related timed new entry ============================ ---8<---------------------------------------- { Ignores new entry signals with x periods of last exit. ©Copyright 2004~2006 Jose Silva For personal use only. http://www.metastocktools.com } { User inputs } pds:=Input("Ignore new entry signals within x periods of exit",0,260,21); plot:=Input("Signals: [1]Clean, [2]Original, [3]NoTrade flag",1,3,1); { Entry/Exit example conditions - do not trade!} entry:=C>Mov(C,21,S); exit:=C<Mov(C,10,S); { Original trade flag and exit } init:=Cum(IsDefined(entry+exit))=1; flag:=ValueWhen(1,entry-exit<>0 OR init,entry); truExit:=(flag=0)*(Alert(flag,2) OR exit*Cum(exit)=1); { Exit-related no-trade flag } noTrade:=If(PREV>0, If(BarsSince(PREV<=0)<pds,1,-1),truExit)>0; { New Entry signal } NuEntry:=entry AND noTrade<1; { Clean Entry/Exit signals } bin:=ValueWhen(1,NuEntry-exit<>0 OR init,NuEntry); long:=bin*(Alert(bin=0,2) OR entry*Cum(entry)=1); short:=(bin=0)*(Alert(bin,2) OR exit*Cum(exit)=1); signals:=long-short; { Plot in own window } If(plot=2,entry,0); If(plot=1,signals,If(plot=2,-exit,noTrade)) ---8<---------------------------------------- [/code:1:ae0d470eee] jose '-)
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.