FlipFlop(Close(0,#Industry),1,-1)
is returning an "Invalid series specified in FlipFlop" error in the screener.
Isn't Close(0,#Industry) a proper series?
Note: ignore the dummy on, off values.
FlipFlop(Close(0,#Industry),1,-1)
is returning an "Invalid series specified in FlipFlop" error in the screener.
Isn't Close(0,#Industry) a proper series?
Note: ignore the dummy on, off values.
FlipFlop()
is intended to be used with GetSeries()
, and, as such, prohibits use of this kind of series. (The proper formula would be FlipFlop(#Industry, 1, -1)
.) What sort of on_value and off_value arguments were you planning on providing as sensible values to this? Or more precisely, what are you trying to do?
FlipFlop(#Industry, 1, -1) doesn't look right to me. The series ID isn't being used as expected (by me).
Anyway, what I was trying to do is;
toggle on when close(0,#Industry)>(sma(50,0,#Industry)*1.05)
toggle off when close(0,#Industry)<(sma(50,0,#Industry)*0.95)
The 1.05, 0.95 terms are negotiable and will be set to provide a sufficient amount of hysteresis to avoid excessive signal toggling.
I expected this to work;
FlipFlop(close(0,#Industry), sma(50,0,#Industry)*1.05, sma(50,0,#Industry)*0.95)
I'll attempt GetSeries().
FlipFlop is not going to work. You are trying to turn multiple industry flipflops ON if the industry if it's 5% above the sma(50) and turn it OFF only when an industry dips at least 5% below
It's designed to work with Aggregate Series for market timing purposes. But that only operates on a single series. You would need multiple SMA series, one per industry, which aggregate series can't do.
You could do it ... with a bunch of pretty nasty code I think
I was planning to use this under Fundamental Charts and as a buy/sell rule - no need for multiple series. The stock context will provide the intended industry.
I'll look at using GetSeries().