I have been programming in TradeStation's Easy Language for over 10 years. Lately, I wanted to reference the most recent price of a trade within a strategy. I thought it would be easy. It is not. I have even resorted to asking several of my EL buddies, and so far, nobody knows. Example: buy 100 shares next bar at market; How can I reference the price I got filled at = ??? All help graciously received and appreciated.
var: ep(0); ep=entryprice(1); if you need further help, right click on the entryprice reserved word from within a strategy and select definition.
entryprice(0) is the current open position. entryprice(1) is the most recent closed position. The recent versions do not use square brackets so it's likely always been that way due to the need to maintain backward compatibility.
so () for referencing a reserved word parameter... such as entryprice(1) and [] in older versions for referencing a bars back value... like High[1] high price one bar ago interesting and just a bit confusing as High is also a reserved word. many thanks.
You just need to use the reserved word EntryPrice. This is what EL programming guide has to say about that: EntryPrice EntryPrice returns the entry price for the current position. It can also report what the entry price was N closed positions ago.
"Last" holds the last price at which the stock traded. For an instant, it will hold your price; then the next trade comes along.
Ah. What did they say when you contacted them telling them that EntryPrice doesn't work as explained in the Reserved Words & Functions Help