Closed Benoth08 closed 3 years ago
please do not use chikou span ... it's simply the candle's close shifted 26 periods into history. This means, a strategy using chikou span will look ok on backtesting - but will fail in every live / dry run scenario, as it is not available for the latest 26 candles.
You can insteda simply use dataframe['close']
- which is exactly the same, but without displacement (ichimoku is mainly a visual indicator - good to look at in charts, tricky to use in strategies).
Thank you very much. Thank you very much. Yes I agree with you ichimoku is very visual but I'm just testing out of curiosity by comparing with other strategies. If I understood correctly, is it the same problem with senkou_a and senkou_b? If I do: dataframe['senkou_a'].shift(-26)), does that return the value to -26?
Apparently in the indicator code you put: senkou_span_a = leading_senkou_span_a.shift(displacement) with "displacement = 26". I should do it instead:
dataframe['leading_senkou_span_a'].shift(-26)), right?
Thanks for your help
shifting it back won't work - the "forward-shifted" candles are removed as they fall out of the index.
You should be able to use the leading_
- but look very carefully at the last few candles of the dataframe for which fields have values (and which ones).
I don't use ichimoku myself, so i can't really help you very well.
I'll close this as i hope you found what you were looking for.
Feel free to comment below if you're still struggling with ichimoku.
Hi @xmatthias , looking at the code here https://github.com/freqtrade/technical/blob/9924ee42a46811ce33bd46ab760d00a6cd0e48b0/technical/indicators.py#L273
it is simply a displacement 26 candles into future ( or , toward the right hand side the graph as seen in trading view ) .
So , if we were to find out if current close is above green cloud that is about to form in trading view, this should do the trick:
(dataframe['senkou_span_a'] > dataframe[senkou_span_b]) # green cloud
& (dataframe['close'] > dataframe[senkou_span_a]) # close is above green cloud
Does the above sound right?
No it does not.
The "shifted" spans will not be dropped within the ichimoku function, but when you merge/assign them to the original dataframe.
The function returns leading_senkou_span_a
and leading_senkou_span_b
as seperate columns - which are the ones that are not displaced, so comparing them directly will tell you exactly what you're looking for in your screenshot.
Thankyou, that makes sense. Is there a way I can access ichimoku within populate_buy_trend without using dataframe merging?
Alternatively, i think we can do the comparison within the populate_indicators function and store only the result.
You get the non-shifted indicator. For "machine" comparison, that will suffice (it's actually exactly what you want). While it may not look that nice on charts - it's exactly what you needed. The shift of the original indicator may look nice on charts - but is unusable as is for machine comparisons.
Not merging will fail as the dataframes are then of different length (or will be shifted).
Hello, there may now be any way to occupy chikou in a real time trading strategy with freqtrade? I would like to try to use the indicator but I can only do it through backtesting. @xmatthias @berlinguyinca @shroukkhan
@matiman86
There is nothing more to say than the comment in the docstring:
Which also explains why you "can" use it in backtesting (and probably get good results) - but not in live.
Good morning, everyone,
I hope you're all right. I'm turning to you to answer a quick question about the use of the ichimoku package. I would like to integrate the ichimoku into my Freqtrade trading strategy, but I'm a bit of a beginner. I would like to see how I can use chikou span in my strategy and compare it to senkou_a and senkou_b 26 periods backwards.
In ichimoku's basic strategy, for a buy signal, the price at time T or chikou must be higher than the value of senkou_a and senkou_b 26 periods backwards. I would like to know how I can incorporate this into my strategy.
Is this correct?
(dataframe['chikou']>dataframe['senkou_a'].shift(-26)) & (dataframe['chikou']>dataframe['senkou_b'].shift(-26))
Thanks