profitTarget in dolar value


Is there a way to set an exit based only on profit target ... similar to EasyLanguage SetProfitTarget(1000) which means exit current position (regardless of position size) when total position profit is $1000?

I know there is ApplyStop (which could be set on type = stopTypeProfit) with mode = stopModePoint - does that provide a delta in points for your exit, say for a long position entered at price 10, with:

ApplyStop(stopTypeProfit, stopModePoint, 5, True, True);

=> would this provide an exit when price reaches 15?

Would this be the closest to EasyLanguage's { SetProfitTarget(1000) } where, given we are talking about a futures instrument, one would need to adjust between points-delta and $profit target (depending on big-point-value)?

Or is there a simpler equivalent to { SetProfitTarget(1000) } ?

=> would this provide an exit when price reaches 15?

Yes, obviously. AFL Function Reference - APPLYSTOP

When PointValue == 1 (it is by default), then "point" means a dollar. So 5 points of profit is $5.

roger, and is there a "OpenPositionProfit" equivalent for open position performance evaluation?

Also, another interesting aspect, for the duration of an open position, 3 things are interesting:

  1. current open position profit
  2. max position profit experienced during "this" open position so far
  3. max drawdown experienced during "this" open position so far

are there some simple functions/tricks to trace these stats for an open position?


AmiBroker is NOT Tradestation.

Tradestation is obsolete as it works only with single symbol backtest with one programming paradigm (implicit loop so EasyLanguage formula is implicitly iterated over and over bar by bar).

AmiBroker features portfolio-level backtesting with RANKING. Therefore it is MUCH more complex than Tradestation.

Generally it uses TWO phases. During first phase when signals are collected, there is no "profit". Only AFTER first phase when all signals are ranked according to position score there is time for SECOND phase (actual portfolio backtest).
In the actual portfolio backtest you can access individual positions profit (again SEE THE MANUAL, everything is in the Users Guide Porfolio Backtester Interface Reference)

BUT.... it is not recommended for newbies. Newbies should use ApplyStop as it handles everything and does not require any manual calculations. You just say what profit you like and default portfolio backtest (built-in) handles all for you.

DO NOT apply "Tradestation" thinking to AmiBroker. TS is nowhere near to AB in terms of capabilities.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.