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

Set breakeven , setpercentTrailing , setDollarTrailing built in stops (TS2000i)



PureBytes Links

Trading Reference Links

How to modify  Set breakeven , setpercentTrailing and SetDollarTrailing
built in stops (TS2000i)  (or create a similar personal version ) ?


1/ I am trying to have a breakeven stop exit, at *entryprice plus
Slip&commission*  after a flooramount has been reached, and want it to be
calculated  on the bar of entry not waiting for the close of the bar or next
bar.
This is normally the way the built in stop  setbreakeven is supposed to work
in TS2000i according to easyLanguage ref guide. (see under).

But it does not work for me that way neither in backtesting nor in real
time.
It exits at the exact entryprice, not at the entryprice + commission
specified in the cost tab of the strategy.
Thus making a loosing trade (commission and slippage) not an even one.

Does somebody knows how I can do what I want or modify the code to do it ?


2/  I have a similar problem with the SetPercentTrailing and
SetDollarTrailing
 built in Stops, that I would want to modify to meet my own requirements.

Does anybody know how I can either have access to the built in code and
modify it or how I can write my own calculated on a updated tick by tick
basis in real time right within the entry bar ?

Is there any way or trick to do that ?

Thanks in advance for any advice.
Philippe.


Essylanguage ref guide for TS2000i

The built-in stops are unique because the reserved words they use are
recalculated on every tick instead at
the completion of a bar. In other words, they are active on the bar of entry
and updated
for every bar of a position on a tick-by-tick basis. All other EasyLanguage
instructions
you write are calculated at the completion of a bar only.

SetBreakEven(FloorAmnt)
When the profit (for the position or per contract/share) exceeds the
breakeven floor, an exit order is generated. 
The exit order is a stop order placed at the entry price (average entry
price if multiple entries) plus the commission specified in the Costs tab.