Script Help: Close above Ichimoku cloud

Optuma Forums Optuma Scripting Script Help: Close above Ichimoku cloud

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #68055
    John
    • Topics: 2
    • Replies: 0
    • Posts: 2

    I am trying to create a watchlist with specific true/false metrics.

    I can’t figure out how to script a close above the Ichimoku cloud.

    I am using CLOSE() >  ICHIMOKUCLOUD(DEFAULT=CloudBandUpper);

    and I tried: CLOSE() > ICHIMOKUCLOUD(DEFAULT=SenkouSpanA); and CLOSE() > ICHIMOKUCLOUD(DEFAULT=SenkouSpanB);

    The True/False result doesn’t match the actual chart. Not sure what I am doing wrong.

    Thanks for any help!

    #68059
    Matthew
    • Topics: 5
    • Replies: 609
    • Posts: 614

    Hi,

    The Ichimoku Cloud plots past the last bar.  The script is referencing the last value of the tool, which in your screenshot the Close is below, causing the criteria to fail.

    To achieve the result you are after you need to lock the Ichimoku Clouds function to the bars, so it does not go into the future.

    The best way to do that is using the BARINDEX() function as per the following…

    Once done, the expected results are returned.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest