Stop triggered (Ichimoku)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #174880 quote
    squale2001
    Participant
    New

    Hi

    I’m using the Ichimoku and I’d like to exit a short position if the close price of the previous candle goes above the Tenkan or Kijun lines + a few pips (yellow and orange lines on the picture). The problem is that the stop is triggered even if the price never goes up those two lines (see picture). The problem is caused by “(close[1] > KijunSen1[1]+ExitTenkanKijun*pipsize”. If I change [1] to [0] it works and doesn’t trigger the stop. Why ? The Tenkan part of the code doesn’t cause any problem. Thanks

     

    Tenkansen1 = (highest[9](high)+lowest[9](low))/2
    Kijunsen1 = (highest[26](high)+lowest[26](low))/2
    
    If (close[1] > Tenkansen1[1]+ExitTenkanKijun*pipsize) OR (close[1] > KijunSen1[1]+ExitTenkanKijun*pipsize) Then
    EXITSHORT AT MARKET
    Endif
    Capture1.png Capture1.png
    #174894 quote
    squale2001
    Participant
    New

    I specify that if I write the price of the Kijunsen line instead of KijunSen1[1], it works well…

    #174898 quote
    squale2001
    Participant
    New

    Solved, I had defined the tenkansen1 and Kijunsen1 variables outside the TIMEFRAME, without defining these variables for every timeframes

    GraHal and Midlanddave thanked this post
    #174904 quote
    JC_Bywan
    Moderator
    Master

    Thanks very much for having given your solution to conclude this topic. Just a quick moderation point, please do not double post, even in 2 different forum languages, in order to respect the publication rules given in the yellow box at the bottom of this page, thanks (we’ll delete the topic in french forum, second after current one in chronoligical order).

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

Stop triggered (Ichimoku)


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
squale2001 @squale2001 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by JC_Bywan
4 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/07/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...