Merhaba
pLeft := 3;
pRight := 3;
PivotLow := If(
Ref(L, -pRight) = LLV(L, pLeft + pRight + 1),
Ref(L, -pRight),
0
);
LastPivot1 := ValueWhen(1, PivotLow > 0, PivotLow);
LastPivot2 := ValueWhen(2, PivotLow > 0, PivotLow);
Idx1 := ValueWhen(1, PivotLow > 0, Cum(1));
Idx2 := ValueWhen(2, PivotLow > 0, Cum(1));
SupportUp := LastPivot1 > LastPivot2;
BarsDiff := Idx1 - Idx2;
Slope := (LastPivot1 - LastPivot2) / Max(1, BarsDiff);
SupportLine := If(SupportUp, LastPivot2 + (Cum(1) - Idx2) * Slope, Null);
BuySignal := SupportUp AND Cross(C, SupportLine);
SellSignal := SupportUp AND Cross(SupportLine, C);
cross(valuewhen(1.,BuySignal,c),c)
Şeklinde deneyebilirsiniz
Bilgileirnize.