- ago
With Build 4 of finantic.Eval it is now possible to implement the famous "OneNight w Moving Percentile" strategy with Building Blocks.
see https://www.wealth-lab.com/Discussion/Percentile-based-indicators-11468

This build fixes two problems found by paul1986 (see link above).

finantic.Eval is available form the Extensions page:
https://www.wealth-lab.com/extension/detail/finantic.Eval
1
934
6 Replies

Reply

Bookmark

Sort
- ago
#1
Thanks for the continued updates to this extension, I've found it to be really essential to my strategy designs. Something I've wondered while using it: could there be a way to reference LastOpenPosition.BarsHeld or LastOpenPosition.ProfitPercent in an Eval(...) expression?
0
Glitch8
 ( 11.64% )
- ago
#2
Since indicators exist in a space that does not necessarily have a Strategy (a plain chart for example) they don't typically have access to Strategy-related information. But let's see what DrKoch says.
1
- ago
#3
@DrKoch: just wanted to follow up to see if there might be any way to reference either of those variables in an Eval function string
0
- ago
#4
QUOTE:
see if there might be any way to reference either of those variables

Hi mdosey,
I am a bit confused about your request. Let me ask you: What do you try to accomplish?

Short answer: it makes no sense to mix LastOpenPosition.Something with an indicator.

Long answer: The Eval indicator is a mechanism to combine several indicators (i.e Time Series) in complex ways like:

CODE:
Close - 0.7 * ATR(bars, 10)

All elemets in this formula are either TimeSeries/Indictors or some constants which are applied to every element in the time series.

The formula can be understood as a calculation which is applied for every bar in parallel.

On the other hand LastOpenPosition.Something are numbers which exist only at one point in time. It is not possible to combine an ATR(bars, 10) with LastOpenPosition.Profit in any meaningful way.

Again: Let me know what you are trying to do, probably there is a useful solution...
0
- ago
#5
I want my exit condition to adjust based on how profitable/unprofitable my position is, or based on how long I've held the position.

Simple contrived example:

QUOTE:
Sell at Limit 0% above Eval("High * (2.0 - BarsHeld/100)")


The longer the position is held, the further we drop the price we'll sell at.

These kind of things could of course be accomplished with a coded strategy, but EvalOpt has the benefit of allowing optimizations without needing to switch to coded strategies.
0
- ago
#6
I think to do this with building blocks you need a new Condition building block that feels like the Eval indicator but is something completely different.

I filed a #FeatureRequets for it:

https://wealth-lab.com/Discussion/Feature-Request-New-Building-Block-Generic-Condition-11575
1

Reply

Bookmark

Sort