Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 6/19/2005(UTC) Posts: 39
|
Hi,
ever neophyt I am .
My exit trigger is simple : Cross(MACD(),Mov(MACD(),8,E)) but it exit too early .
Will somebody tell me how exit later with the same or another trigger ?
Thanks,
Pierre
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Hey Dadabe-
Check out the REF() function in the user's manual and in the Primer. It sounds like it might help you out. If I understand your question right, you just want to shift the signal that is being generated. try this:
a:=Cross(MACD(),Mov(MACD(),8,E));
b:=Ref(Cross(MACD(),Mov(MACD(),8,E)),-1);
a;b;
Also, look at this code to see the differences:
a:=Mov(Ref(C,-1),5,S);
b:=Mov(C,5,S);
a;b;
I think that this might help answer your other question regarding timing too.
g_ :D
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 6/19/2005(UTC) Posts: 39
|
Hi,
I'ts a likable answer to my question .
To day, I've got another problem with programming TRADESIM .
The formula under exit well from Editor but don't enter in TradeSim .
I don't find my error :
EntryPrice := C;
EntryTrigger := L> L-1
AND L-1> L-2 ;
ExitPrice :=C;
ExitTrigger := H< H-1
AND H< H-1
AND H-1< H-2 ;
InitialStop:=0; {optional initial stop used }
NewEntryPrice := C;{entry price at next days open}
NewEntryTrigger := Ref(EntryTrigger,-1);
NewExitPrice := C;{exit price at next days open}
NewExitTrigger := Ref(ExitTrigger,-1);
ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.RecordTrades","01-My system",LONG ,NewEntrytrigger , NewEntryPrice, InitialStop, NewExitTrigger, NewExitPrice,START );
Best regards,
Pierre
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Since I'm not at all familiar with TradeSim, someone else will need to jump in and probably follow this through, but I do see that there is a redundant statement in your ExitTrigger code:
Quote:ExitTrigger := H< H-1
AND H< H-1
AND H-1< H-2 ;
I believe it can be reduced to this:
ExitTrigger:= H< H-1 AND H-1< H-2;
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 6/19/2005(UTC) Posts: 39
|
Thanks,
I'ts wonderfull the Metastock world .
I'll work with Formula Primer I've found here as you said me .
Best regards,
Pierre
|
|
|
|
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)
|
Pierre wrote:I don't find my error :
EntryTrigger := L> L-1
AND L-1> L-2 ;
ExitPrice :=C;
ExitTrigger := H< H-1
AND H< H-1
AND H-1< H-2 ;
Pierre, try this:
[code:1:a11054e0fc]EntryTrigger:=L>Ref(LLV(L,2),-1);
ExitPrice:=C;
ExitTrigger:=H<Ref(HHV(H,2),-1);
[/code:1:a11054e0fc]
jose '-)
http://metastocktools.com/#metastock
.
|
|
|
|
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.