Matthew Greenslet![]() Idol ![]() ![]() ![]() ![]() Posts: 2077 Joined: 2/27/2006 ![]() | You have to think of the root construction of a stops as two properties. One that contains a floating point number which is our calculated exit level and one that is a boolean (true/false) that tells us if need to fire the exit. In OmniLanguage you set your ExitLevel property like this... ExitLevel = nSomeSingleValue Your boolean FireExit property is set by setting the current signal to an exit like this... Signal = ExitSignal When you write your stop code it is your responsibility to set these two properties and keep them in sync. However there is one rule in particular that you have to follow and that is, you can not change the value of your Exit Level intra-bar. Only on the next bar will the last change made to your ExitLevel property take affect. One other behavioral note. The vote line handles stop level slightly differently than trade plans. With a Trade Plan your exit is checked everytime new data is received whether it be new ticks in RT or On-Demand downloading in EOD. This way exits are fired as soon as they are met giving us the ability for intra-bar virtual stops (that is the broker is unaware of the exit level since it is not a broker stop). From a vote line perspective we have two paths. One where the exit has a known exit level (use of ExitLevel = nSomeSingleValue is not required) and one that doesn't. We can not do any exit calculation except on the one bar where our FireExit property is set (you have set Signal=ExitSignal). On that bar if our ExitLevel property has not been set then we then we assume the close of the bar. Since that order can not be sent until the close of the bar (to ensure our signal does not disappear) our exit fires at the first tick (open) of the next bar. If we have set an exit level we first check it against the open. If the exit level was violated at the open we use the open price for the simulated exit price. If the ExitLevel is outside the range of the bar it treats it the same as if there was not exit level. If the exit level is within the range of the bar it always uses the exit level as the simulated exit price. One think you need to know before understanding how the trade plan is processes is that each tick (or data update) the current bars close price is updated. This continues until we receive the first tick of the next bar. A trade plan is not tied to the analysis in any way. Therefore it does not require analysis to be ran in order for it to update. A trade plan is analyzed each tick (or data update). Nothing is transmitted to the broker until the FireExit property = true. At the moment the FireExit property = true it will fire off the chosen order type to the broker. There is one exception to this rule which is level based orders tied to a virtual level but we can cover that later. That said, from a trade plan perspective you can use either the C < LLV(3)[1] Or you can use L < LLV(3)[1]. Either one will return true as soon as the price ticks below your level (at least in real time). In EOD it would be possiable to update data and the low tick below your exit level but the close is still above it. If you used the close price in your conditional to set your FireExit property, in this case the Trade Plan would not fire the order to your broker since the FireExit boolean is still set to false. If you wanted to fire intra-bar stops and you want to avoid this, use the low since this will return true as soon as data is received that violates your your. |