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
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
Rename
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?
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.
@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
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...
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:
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.
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.
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
I filed a #FeatureRequets for it:
https://wealth-lab.com/Discussion/Feature-Request-New-Building-Block-Generic-Condition-11575
Your Response
Post
Edit Post
Login is required