[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mix next open with multi data streams



PureBytes Links

Trading Reference Links

I have a problem with some EL code.

I need to test a daytrading system on daily bars.  All entries are at the open, and 
exits MOC the same day, except when an intraday stop is hit.

The buy/sell signals are taken from a second data stream (data2).  This is 
essential since the signals are derived from a program unrelated to TS, and are 
simply imported as indicator values corresponding to each daily close.

I need to calculate the stop as a percentage of the OPENING price on the trade 
day.  The signal is available at the CLOSE of the pre-trade day, and an order to 
buy/sell at market causes TS to (correctly) trade at the next day's open.  
However, any attempt to reference the price at that open (open of tomorrow) for 
stop-calculation results in the message "cannot mix next bar prices with data 
streams other than data1" at compile time

I placed all the exit orders in a separate system, and 'included' it in my main 
system - but with the same result.  I have also tried saving the "open of 
tomorrow" in a variable in the main system, saving that as a global variable 
using a DLL, and then retrieving it within the included system - but the result is 
just the same.

It is ridiculous that I cannot use the actual trade price to calculate the stop.  I 
understand why TS prohibits certain uses of next bar prices to prevent writing of 
self-fulfilling systems, but in this case I merely want to reference the price which 
TS is already allowing me to trade so I can set a stop relevant to that price.

I have used the included system method succesfully for single-data charts, but 
in this case I MUST use a multi-data chart.

Any suggestions would be most welcome.

Bob Young