Ichimoku Kinko Hyo

Hi. I need help for a code in using the kumo cloud crosses to place Buy and Sell order. To protect unwanted and immature signals are 2 filters: 1) Price action crosses of Tenkan line and 2) the position of the +DI and the -DI line in the ADX indicator.
The strategy : 1) New order(Buy) when the kumo twist crosses over from Bearish to Bullish trend , i.e. moving upwards, And the current Price action bar (candlestick) is bullish and crosses Above the Tenkan line.
2) Sell (New trade or Close Existing trade): When the Kumo twist crosses over from Bullish to Bearish trend, i.e. moving downwards. And the current Price action bar (candlestick) is bearish and crosses Below the Tenkan line.
The ADX +DI must be Above the -DI line to confirm the Buy order. (Uptrend)
The ADX - DI line must be Above the +DI line to confirm the Sell order.(Downtrend)
Stop Loss is 40 points . Take Profit is based Only on the Opening or Closing of a Trade by the signals. Should there be no trigger for new trade, then the current opened position will continue to run.
Thank you
regards