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/28/2009 7:25 AM
Post #11329 - In reply to #11326

Excellent explanation, Matthew! Thank you!

I'm very interested to hear the rest of the story re "virtual" stops, which are mysteries in the manual (and to me). The explanation you gave below SHOULD be a part of the manual. Kudos.

I'm hoping that somehow the "virtual" stops provide a way to programmatically set the exit levels used by the Limit and/or Stop and order types. If so, then Greg's needs will be perfectly met ... OT can eval his thresholds the night before, and immediately send a (non-pre-market) Limit or Stop-Limit or Stop-Market order to the broker before the next day's open, to be applied after/at the open (depending on order type), without going through any manual EOD rigamarole described in boring detail below. MANY OF US WANT TO DO THIS!

------

To answer Greg's question ... yes, you can "set a stop at night (or in a backtest) at a cetain level that would get me out of trade at that specific level (price) the following day." BUT, barring some cool use of "virtual" stop levels that I mentioned earlier, it requires things to be done in a specific way during the next trading day, so that your backtest method matches your execution method.

Here is my understanding of Matthew's explanation, put in a bit more explicit terms for you. I trust that Matthew will correct me if I've made any errors.

For backtesting, you write a formula similar to the ones that Matthew mentioned, using the [1] syntax. That suffix tells the engine to compare the current-day's L or C to the LLV-period that ended on the PRIOR day (ie the night before).

During the backtest simulation, if you use C in the formula, the order would not fire unless the full-day's bar's Close (ie the "real" close) was below the threshold. In that case, you don't need to set an exit level, since the program will assume the Close to be the exit level. Just use the boolean C < LLV(3)[1] forumula for the signal logic ("boolean" means a true-false formula).
However, if you use L in the boolean exit-signal formula for backtesting, L < LLV(3)[1], the order will fire if the Low for the day is below the LLV(3) that was determined the night before (as you requested). In this case, however, you need to set the exit LEVEL to be equal to a scalar (single precision, numeric) value of LLV(3)[1] in addtion to boolean formula above. This will assure that the backtest simulation gets you out at the LLV price level, rather than at the Close.

-----

For actual trading, this works differently, depending on if you have a true RT feed, vs if you have an EOD feed that you manually update once a day (about 15 min before the close), vs if you have an EOD feed that you update manually many times a day (to simulate an RT feed, with built in 20-min delay plus whatever manual delay you exercise).

Caution - I am admittedly less confident of my understanding here. I don't currently have an RT feed attached to OT, and I'm not currently using OT to fire orders to my broker, and the issues with the voteline are ones that I'm not very confident about.

If you have a true continuous RT feed, then you can use EITHER boolean formula L < LLV(3)[1] or C < LLV(3)[1] to fire the signal ... probably for purity's sake the "L" formula is better. RT causes the "daily" bar to be "reconstructed" with every new tick(update) ... so, during the course of the day, there is always a full set of OHLC values present ... but since the day is not yet complete, the H, L, and C values are subject to change ... especially the C value. In this environment, it's useful to think of the intermediate C value as "R"(recent), and the intermediate H & L values as "X"(max) and "N"(min) ... I've found that if I write out logic and trading rules this way, it helps me avoid making mistakes. Anyways ... as the day progresses with the RT feed, and as the XNR values continually are updated, then the boolean formulae also continually are checked. As soon as the boolean formula's value is TRUE, then the exit signal fires, and the broker presumably uses the "close" as the exit point (presuming a Market order) ... but it's really not the real Close ... it's the "R" value I mentioned earlier.

OK, now let's presume that you don't have RT, but you do in fact manually update EOD many times each day (say, once every half hour). Keep in mind that the EOD feed is 20-min delayed, so an update at 10:00 really represents the values at about 9:40 (this is not a precise thing, btw). So, think of this as a "really slow RT feed". With that in mind, the same logic I described for the RT feed above applies here ... the XNR values "look" like HLC values every time you do an update. In this case, if your use the boolean formula L < LLV(3)[1], you will to capture the price "wiggles" that occured between your manual updates. If you want to IGNORE the intermediate "wiggles", use C < LLV(3)[1]. If you want a clever way to ignore TRANSIENT wiggles, then try something like (L+C)/2 < LLV(3)[1] ... I particularly like that last approach, btw :~)
In this case, you don't need to set the exitlevel, since if the boolean is violated, it will just use the R (most recent close) price.

Finally, if you just do ONE manual update each day, prob about 15-30 min before the close, then for all intents and purposes you ARE doing an "on Close" exit. So, for the boolean exitsignal test, you can use either C < LLV(3)[1] if you want "precise" logic (see the Aristotle quote in my sig about this), or maybe opt for something like (L+C*2)/3 < LLV(3)[1] instead. Either way, if the formula eval's to TRUE, the broker's market order will execute approximately at the R value (which presumably is similar to the final Close if the market is not moving too fast).

----------

Tolja it would be long and boring! I hope it helps. And if I'm incorrect in any particulars, I'm looking forward to Matthew's clarifications. This kind of info is INCREDIBLY important for us all to understand in a crystal-clear fashion.

=================

The big missing link here IMO is that we can't (to my knowledge) set the Limit or Stop values in the trade plan programmatically (ie dynamically based on prior-day's data). Maybe the "virtual" thing that Matthew has yet to explain does make this possible. If/when it IS possible, then the NIGHT BEFORE, OT can automatically determine the thresholds for the stops (based upon LLV(3) or whatever fancy formula the user wants), and UPDATE the Limit / Stop thresholds which would then be sent off to the broker before the next day begins. I don't think this is currently possible in OT, but it should be a priority, since THAT'S THE WAY THAT MANY TRADERS ACTUALLY OPERATE.

Thanks for your patience, Greg, and your able help, Matthew!

[Edited by Jim Dean on 1/28/2009 7:32 AM]

Deleting message 11329 : RE: Intraday Stops


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