I probably can't see the forest for the trees...
I try to use a formula in the eval that refers to a bar, e.g. three days ago.
The FxComposer gives me [-3] as a suggestion for “other” (“index past values” is the description of this function).

However, if I work with [-3], the formula does not work.
Here is an example: open[-3]-lowest(low,5)
This is just an example to illustrate. The lowest low of the last five candles should be subtracted from the open three bars ago.
The range with “lowest(low,5)” works, only the part “open[-3]” does not work. “open(3)-lowest(low,5)” does not work either.
I'm just looking for the code snippet that refers to previous open or close values. Can anyone help me?
I try to use a formula in the eval that refers to a bar, e.g. three days ago.
The FxComposer gives me [-3] as a suggestion for “other” (“index past values” is the description of this function).
However, if I work with [-3], the formula does not work.
Here is an example: open[-3]-lowest(low,5)
This is just an example to illustrate. The lowest low of the last five candles should be subtracted from the open three bars ago.
The range with “lowest(low,5)” works, only the part “open[-3]” does not work. “open(3)-lowest(low,5)” does not work either.
I'm just looking for the code snippet that refers to previous open or close values. Can anyone help me?
Rename
Following your example I created this Building Block strategy:
(see next Post)
It has this expression for the limit price:
When I go "Open as C# Coded Strategy" I see it coded correctly in C#:
Explanation:
The expession uses "Open" with a capital "O". That is also what FxComposer suggests.
(see next Post)
It has this expression for the limit price:
CODE:
Open[-3]-Lowest(Low,5)
When I go "Open as C# Coded Strategy" I see it coded correctly in C#:
CODE:
// FxBuy: Buy at Limit // Limit Price: Open[-3]-Lowest(Low,5) double limitPrice = bars.Open[idx-3]-indi1[idx];
Explanation:
The expession uses "Open" with a capital "O". That is also what FxComposer suggests.
And after rereading your original request:
I guess the Eval indicator does not support the array index operator. Open[-3].
Please use the FxBlocks instead.
I guess the Eval indicator does not support the array index operator. Open[-3].
Please use the FxBlocks instead.
@DrKoch: Thank you for the answer. The capital O was not the cause. It does not work with a capital O. It does not seem to be supported (as you already wrote). Could you add support for the array index operator for the next build? Unfortunately, the FxBlocks are of no use to me as they only support limit and stop orders.
Please describe your use case, i.e. what exactly do you try to accomplish?
The Eval indicator works with complete indicator series, so acces to a single (probably shifted) value makes no sense in this context.
The Eval indicator works with complete indicator series, so acces to a single (probably shifted) value makes no sense in this context.
If you want
as an indicator series, you should use the OffsetInd() indicator to shift the Open series by three bars:
QUOTE:
The lowest low of the last five candles should be subtracted from the open three bars ago.
as an indicator series, you should use the OffsetInd() indicator to shift the Open series by three bars:
CODE:
OffsetInd(Open, 3) - Lowest(Low, 5)
If I enter “OffsetInd(Open, 3) - Lowest(Low, 5)” in the Eval, the result is neither smaller nor larger than 0. In other words, unfortunately it doesn't work either. I would like to create candle patterns with the Eval.
Sorry, there was a typo. I recreated your question:

The IndicatorExpression for the Eval Indicator should be:
The IndicatorExpression for the Eval Indicator should be:
CODE:
OffsetInd(bars, Open, 3) - Lowest(Low, 5)
@DrKoch: It works :-) Thank you very much!
Your Response
Post
Edit Post
Login is required