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

EL help needed.



PureBytes Links

Trading Reference Links

Greetings gentles all.

I'm trying to code something in EL and was wondering whether I'm going
about it the hard way.  Your assistance would be greatly appreciated.

I enter long on a particular bar at some particular price and I want to
make the stop the previous bar's close minus some step value.

How does one refer to the bar that is one back from the Entrybar?

At the moment I am waiting until the bar after entry and using something
like:

   If BarsSinceEntry = 1 and MarketPosition > 0 
   then ExitLong at Close[2] - step

   If BarsSinceEntry = 1 and MarketPosition < 0 
   then ExitShort at Close[2] + step

Alas, this approach is not proving very reliable.  Usually what happens is
that 10 or 20 bars later in the day the market will go thru the stop price
and not exit the position.  Its like the order is not valid any more?  Or
TS has forgotten about it?

Any help on devising a strategy to achieve a reliable solution would be
great appreciated,  8-)

Murray.