OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


Only Forum Moderators, Administrators, and the owner of this message may delete it.

 
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Intraday Stops
Posted : 1/29/2009 12:41 PM
Post #11365 - In reply to #11364

Actually, I just realized that there is a third option, which allows the EOD trader to go beyond the only-one-broker-order-at-a-time-and-no-intraday-manual-updates-so-no-virtual-orders limitation.

If we presume that all of the actual real-life broker orders are placed by the trader external to OT (ie not using the OT brokerage module), but rather thru TWS or phone or whatever, then we CAN simulate (some) multiple virtual order logic situations in backtest, even if one is profit-side and one is loss-side, AND carry them out in real life.

Without going thru a full example ... the proposed virtual combo of several profit grab and stop loss levels with differing exit percentages, etc could all be modelled in an EOD based backtest, as long as the rules in my #1 and #2 are followed.

#1V case: if the OmniScript ExitSignal is of the form "C < formula", then the broker order MUST be Stop Market On Close with "formula" as the stop level. It is of course possible that several different formula alternatives could be set virtually based on things that happened ... but in every case, the SMOC would exit at or close to the Closing price for the day, if any of them fired. So, this approach has marginal usefulness.

#2V case: if the OmniLanguage Stop's ExitSignal is of the form "L < formulaA" or "H > formulaB", AND if an ExitLevel is set in the stop's code, then multiple virtual stops &/or grabs could be implemented to simulate intraday action that a broker would take if the broker was given several Stop Market orders. The eval of each formula would be done in real life the night before, and the trader would have to manually enter the group of orders, rather than asking OmniBrokerage to do it.

This (2V) approach raises an interesting question. You mentioned earlier that if two virtual stoploss orders were active, the closer one to the Open would be used in the backtest eval. BUT, what if that was only a PARTIAL exit, leaving a nonzero position size behind after execution? If the price continued to go against the position, after the closest order fired, and it finally passed the more distant stop level during that same day, would the backtest engine (EOD, mind you) then execute the second stoploss order, applied against the remaining shares?

If the day was really volatile and the ExitLevels were pretty tight, and if all were Partial Exits that summed <=100%, then TWO on the profit side and TWO on the loss side (all at different ExitLevels) could ALL fire in one day, IN REAL LIFE, as the broker executed them in real time.

I'm guessing that until you get the OHLC vs OLHC logic installed, we are stuck with either JUST the loss-side pair firing, or JUST the profit-side pair firing, or JUST the first one firing. That is, the current backtest code in EOD mode treats all of those four virtual stops as OCA (One Cancels All) orders. Ungood, if partial exits are the desire. Please clarify what happens in this scenario, for the program as-is.

Finally - when (hopefully not "if") you get the OHLC vs OLHC logic in place, PLEASE ALSO ADD ORDER DISTINCTIONS FOR OCA.

I look forward to whatever corrections you might share. This has been an interesting and worthwhile discussion (for me at least). Thanks again!

[Edited by Jim Dean on 1/29/2009 12:44 PM]

Deleting message 11365 : RE: Intraday Stops


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.