PDA

View Full Version : Exit Price Issue


Metastockuser
15th December 2003, 12:52 PM
Ok, here's another one. The last thing that has me stumped as I attempt to work this out.

By the way, what I'm doing is using a third party product called "ICE" to help me organize my building of a trade system. And, of course, then attempting to build a trade data base for testing in Trade Sim.

In the Metastock 8.01 Enhanced System tester the ICE exit Formula is set up in the "sell" tab as a stop (stop button filled in) with the formula:

min(ref(Fml("zAdaptick - Generic Stop Long (Loose)"),-1),open)

This apparently looks back one day and exits if the propritary trailing stop loss value is crossed.

In the enhanced system tester it works fine. It has the affect of creating an exit at the exact price that the trailing stop loss of yesterday is crossed. so I gather that one would look at the new value of the stop each day and change the stop-loss at the broker to match it.

My problem is that I've been unable to create the same effect in my TradeSim data base.

This is what i'm working with:

ExitTrigger:= min(ref(Fml("zAdaptick - Generic Stop Long (Loose)"),-1),open)

ExitPrice := ???

Does anyone have any ideas about getting an ExitPrice to exit at the price level the stop was breached as opposed to open, close, etc?

It appears that the ExitTrigger is working. I'm getting out on the right day, when the stop is breached. I'm able to reference the formula and get out. But how to get the ExitPrice to equal the price when the stop was crossed is beyond me. Nothing I've tried works, however I know very little about programming.

Jose
15th December 2003, 01:32 PM
ExitTrigger:= Cross(ref(Fml("zAdaptick - Generic Stop Long (Loose)"),-1),High);

ExitPrice := ref(Fml("zAdaptick - Generic Stop Long (Loose)"),-1);

Jose
15th December 2003, 01:33 PM
Correction:

ExitTrigger:= Cross(ref(Fml("zAdaptick - Generic Stop Long (Loose)"),-1),Low);

ExitPrice := ref(Fml("zAdaptick - Generic Stop Long (Loose)"),-1);

Metastockuser
15th December 2003, 02:21 PM
The ExitSignal is causing an error:

I'll give you the comments I find under the "Results" tab and the "Rejects" tab when I run with the ExitPrice you suggested. I had tried that before and it just doesn't fly.

It's as if the explorer is looking for soemthing very specific as an ExitSignal. And I've been unable to figure out how to present the ExitSignal to the Exitprice in such a way as to get the Exitprice to more or less function as a stop and to exit as the line is crossed rather than at the open, close, etc
------------------------------------------
Results; Security Name
No securities to report.

Rejects: Security Name Reason for Rejection Location
WASHINGTON MUT Bank Error in column A: An MSX DLL is reporting an internal error. Referenced DLL: "TradeSim.RecordTrades" DLL Message: Invalid security data detected - Check the Error Log for details. C:\MetaStock Data\Tracking Area

Now, if I use something simple like "close" for the exit, I get results. However I get the wrong results because the exit should occur at the stop loss not at the open-close-etc.

Metastockuser
15th December 2003, 02:38 PM
I meant to say the explorer is apparently looking for something very specific for the ExitPrice.

My posted ExitTrigger appears to be working. The TradeRecords indicate that I got out on the correct day. But with slippage set to zero, my exit prices simply do not match the prior days stop which is the ExitTrigger.

Somehow I need to have the ExitPrice equal to the value of the custom ExitTrigger or "stop" from the prior day. Many of my attempts resulted in the same error messages I gave you in my prior post.

Metastockuser
15th December 2003, 02:40 PM
and this is my last explanation.

it appears to me from the Error Message that it's TradeSim creating the error? It's seeing a value or something in the ExitPrice that it does not like.

Metastockuser
15th December 2003, 03:01 PM
that with the formula the way I'm using it...on the days when the ExitTrigger does not occur...the exit price based on the exit trigger is outside of the low to high range of the price action.

Then Tradesim sees an exit price that is outside of the days price range and says it's not valid? Even though it wasn't used? Just a thought.

Metastockuser
15th December 2003, 06:30 PM
It appears to me that the Error message is originating with trade sim.

The exit trigger appears to be working ok.

ExitTrigger := PRICE <= Min(Ref(Fml("zAdaptick - Generic Stop Long (Loose)"),-1),OPEN);

What's killing me is the ExitPrice. I'm getting error messages related to my exit price saying: Security Name Reason for Rejection Location
WASHINGTON MUT Bank Error in column A: An MSX DLL is reporting an internal error. Referenced DLL: "TradeSim.RecordTrades" DLL Message: Invalid security data detected - Check the Error Log for details. C:\MetaStock Data\Tracking Area

I'm not sure but I'm starting to suspect that TradeSim does not like any formula I've been applying to ExitPrice.

Possibly it wants me to use metastock "Data Array values" such as: Close, Current Indicator, High, Low, Open, Open Interest, Previous Value of Indicator, Volume. I can enter a value of say "close" and it works, just doesn't get me out at the price that tirggers the sell.

The exit trigger is entered into the metastock system tester on the sell tab as a "stop" and the formula above. It creates a trailing stop loss line. To use it you have to look back one trading day and see the value of the stop as of yesterday.

Any ideas on how to take this propritary fromula and set it up in the ExitPrice so that TradeSim will take it? Possibly using current Indicator or prefious Value of Indicator? I'm playing around with it but not getting it. Of course I don't understand much about programming or perhaps I'd have it already.

Jose
15th December 2003, 11:56 PM
Basically, anything that works in MetaStock will work in TradeSim.

"What's killing me is the ExitPrice."

Plot the ExitPrice as a MS indicator on a chart, and if it works as intended it will work in TradeSim.

" Possibly it wants me to use metastock "Data Array values" such as:
Close, Current Indicator, High, Low, Open, Open Interest,
Previous Value of Indicator, Volume."

This covers 100% of all ExitPrice possibilities.
Plot your ExitPrice as a MS indicator on a chart and see why it doesn't work.