Identify ADX and PArabolic SAR switchover

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #103637 quote
    Abz
    Participant
    Veteran

    Hello ,

     

    trying to identify when ADX and SAR is switched to bull og bear at the same time see attached screen. Anyone have an idea

     

    myPRCAdaptiveATRADXTrendV2 = CALL "PRC_Adaptive-ATR-ADX-Trend-V2"[21, 3.5, 1.75, 14, 30, 0, 1](close)
    p=SAR[0.02,0.02,0.2]
    
    
    IF not onmarket and myPRCAdaptiveATRADXTrendV2 > close and  myPRCAdaptiveATRADXTrendV2[1] < close[1] and P > close and  p[1] < close[1] THEN
    buy 10 contract AT MARKET
    ENDIF
    
    IF not onmarket and myPRCAdaptiveATRADXTrendV2 < close and  myPRCAdaptiveATRADXTrendV2[1] > close[1] and p < close and  p[1] > close[1] THEN
    sellshort 10 contract AT MARKET
    ENDIF
    Capture-4.png Capture-4.png
    #103645 quote
    Vonasi
    Moderator
    Master

    Your code seems OK (although I have not tested it) except for the fact that the IF NOT ONMARKET will mean that a reverse signal will not close a trade and open one in the opposite direction. Perhaps this is what you want and there is some more code that you have not shared with us?

    Also how often does close cross over the two indicators at exactly the same bar?

    You should try using GRAPH to check the values of the two indicators compared to close

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

Identify ADX and PArabolic SAR switchover


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Abz @abbas_sadiq Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Vonasi
6 years, 7 months ago.

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