View Full Version : Only Long or only Short Trades
Dave
11th February 2004, 05:02 AM
I have an exploration setup which is driving me nuts. I know I must be doing something wrong, but I can't find it. No matter what I do I can only get results which are all LONG or all SHORT.
here is my exploration - can anyone see anything that stands out?
{Entry Exit parameters}
LongTrigger:= Fml( "_TRENDICATOR") =1 or Fml( "_TRENDICATOR") =0;
ShortTrigger:= ref(Fml( "_TRENDICATOR"),-1) <0;
EntryPrice:=OPEN;
ExitTriggerLong:= H>=(ref(c,-1)+Ref(Fml( "___DJID_T_value"),-1));
ExitTriggerShort:= L<=(ref(c,-1)-(Ref(Fml( "___DJID_T_value"),-1)/1.3));
ExitPriceLong:= (ref(c,-1)+Ref(Fml( "___DJID_T_value"),-1));
ExitPriceShort:=(ref(c,-1)-(Ref(Fml( "___DJID_T_value"),-1)/1.3));
{------------------------------------}
ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.RecordTrades",
"DAYF4", { Trade Data Filename }
LONG, { Trade Position Type }
LongTrigger, { Long Trigger }
EntryPrice, { Entry Price }
0, { Optional Initial Stop }
ExitTriggerLong, { Exit Trigger }
ExitPriceLong, { Exit Price }
START); { Start Symbol }
ExtFml( "TradeSim.RecordTrades",
"DAYF4", { Trade Data Filename }
SHORT, { Trade Position Type }
ShortTrigger, { Short Trigger }
EntryPrice, { Entry Price }
0, { No Optional Initial Stop }
ExitTriggerShort, { Exit Trigger }
ExitPriceShort, { Exit Price }
CONTINUE); { }
Thanks
Dave
David Samborsky
12th February 2004, 01:10 AM
Are you sure that you are getting the short triggers?
As a test try replacing the short triggers with the long trioggers and rerun the exploration.
Dave
12th February 2004, 02:09 AM
David - I get only Long Trades if I have the LONG trades recorded first (after the Initialize function is called).
But if I switch around the order, so that SHORT trades would be recorded first, then all I get is short Trades...
Example if I use the following I got on short Trades
ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.RecordTrades",
"DAYF4", { Trade Data Filename }
SHORT, { Trade Position Type }
ShortTrigger, { Short Trigger }
EntryPrice, { Entry Price }
0, { No Optional Initial Stop }
ExitTriggerShort, { Exit Trigger }
ExitPriceShort, { Exit Price }
START); { }
ExtFml( "TradeSim.RecordTrades",
"DAYF4", { Trade Data Filename }
LONG, { Trade Position Type }
LongTrigger, { Long Trigger }
EntryPrice, { Entry Price }
0, { Optional Initial Stop }
ExitTriggerLong, { Exit Trigger }
ExitPriceLong, { Exit Price }
CONTINUE); { Start Symbol }
David Samborsky
12th February 2004, 12:33 PM
Try downloading V4.2.1 of TradeSim.dll from the download page http://www.compuvision.com.au/DownloadTradeSim.htm
Dave
12th February 2004, 10:15 PM
David,
I am using verison 4.2.1.109 of the TradeSim.DLL and
version 3.4.3.669 of the exe
and also version 7.0.2.0 of the MSFL70.DLL
In regards to the MSFL70.DLL - The downloads page states to put this in windows/system directory. I have done this, but I have Windows 2000 and there is also a system32 directory with MSFL651.DLL , MSFL72.DLL and MSFL80.DLL. Should I put it in the System32 Directory instead?
David Samborsky
15th February 2004, 06:43 AM
You should install MSFL70.dll into the system32 directory.
Also can you send me the complete formula including the external indicators all assembled into one formula so that I can quickly diagnose your problem.
Dave
17th February 2004, 04:15 AM
David,
I have been doing a lot of troubleshooting and have found an issue that may, or not be due to my inexperience.
One of the triggers I use to enter Long or Short I use a complex formula that references external data from other securities using the
Security("Symbol", Data Array) function.
When I Do not use values dirived using this function (substitute another variable, not using this function) my Tradesim database has long and short trades listed.
But when I use the function to determine a variable for use in the tradesim entry trigger, entry price, exit trigger and exit price the database only records long trades if the I record long trades first or it records only short trades if I have the short trades recorded first.
I understand this may be confusing, but I will outline in more detail if required.
Thanx in advance...
David Samborsky
18th February 2004, 01:30 AM
Thanks for the insight into the problem.
You must be using Version 8 or Version 7 professional as only these version have the Security function.
Dave
18th February 2004, 01:37 AM
yes, version 8 pro
David Samborsky
18th February 2004, 01:43 AM
As an experiment what happens if you intersperse your formulas such that the short expressions are inserted between the two calls to the record trades functions.
{Entry Exit parameters}
LongTrigger:= Fml( "_TRENDICATOR") =1 or Fml( "_TRENDICATOR") =0;
EntryPrice:=OPEN;
ExitTriggerLong:= H>=(ref(c,-1)+Ref(Fml( "___DJID_T_value"),-1));
ExitPriceLong:= (ref(c,-1)+Ref(Fml( "___DJID_T_value"),-1));
{------------------------------------}
ExtFml( "TradeSim.Initialize");
ExtFml( "TradeSim.RecordTrades",
"DAYF4", { Trade Data Filename }
LONG, { Trade Position Type }
LongTrigger, { Long Trigger }
EntryPrice, { Entry Price }
0, { Optional Initial Stop }
ExitTriggerLong, { Exit Trigger }
ExitPriceLong, { Exit Price }
START); { Start Symbol }
ExitTriggerShort:= L<=(ref(c,-1)-(Ref(Fml( "___DJID_T_value"),-1)/1.3));
ShortTrigger:= ref(Fml( "_TRENDICATOR"),-1) <0;
ExitPriceShort:=(ref(c,-1)-(Ref(Fml( "___DJID_T_value"),-1)/1.3));
ExtFml( "TradeSim.RecordTrades",
"DAYF4", { Trade Data Filename }
SHORT, { Trade Position Type }
ShortTrigger, { Short Trigger }
EntryPrice, { Entry Price }
0, { No Optional Initial Stop }
ExitTriggerShort, { Exit Trigger }
ExitPriceShort, { Exit Price }
CONTINUE); { }
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.