ProOrder triggers different from Indicator

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #158834 quote
    Philippo
    Participant
    Average

    Hi, I have  a Strategy which i find behaves differently from expected and I can’t figure it out.

    its based on CCI crossings  for entry points and appears to be entering a more often than I think it should.

    SO I’ve attached the code and the chart with the problematic area. In the red rectangle is the area of interest, the purple circle shows two entry positions which have triggered whereas the variables I am drawing (entryup, entrydn, exit up, exit dn) in this case entry down do not appear to trigger. But I can’t see why or how a buy signal can be created without the necessary entrydn condition being met.

     

    What am I doing wrong, it can’t be a PRC error. Thanks.

     

    myCCI=CCI[20]
    CCIMA=Average[20](myCCI)
    
    
    crossCCIup = myCCI > CCIMA
    crossCCIdn= myCCI < CCIMA
    
    if longonmarket then
    ccimaup = ccima > 70
    ccimadn = ccima < -70
    else
    ccimaup = ccima > 10
    ccimadn = ccima < -10
    endif
    
    Vup = mycci>mycci[1] and mycci[1] < mycci[2]
    Vdn= mycci<mycci[1] and mycci[1] > mycci[2]
    
    entryup= ccimaup and Vup
    entrydn= ccimadn and Vdn
    
    
    exitup = myCCI crosses under -100
    exitdn = myCCI crosses over 100
    
    
    
    if entryup then
    buy 1 contract at market
    SET STOP TRAILING SAR[0.02,0.02,0.09]
    endif
    
    if entrydn then
    SELLSHORT 1 contract at market
    SET STOP TRAILING SAR[0.02,0.02,0.09]
    endif
    
    GRAPH exitup coloured (255,0,0) as "Xup"
    GRAPH exitdn*-1 coloured (155,0,0) as "Xdn"
    GRAPH entryup coloured (0,255,0) as "UP"
    GRAPH entrydn*-1 coloured (0,155,0,0)as "DN"
    
    
    if exitup then
    sell COUNTOFPOSITION contracts at market
    endif
    if exitdn then
    EXITSHORT COUNTOFPOSITION contracts at market
    endif
    myCCI=CCI[20]
    CCIMA=Average[20](myCCI)
    
    Screenshot-2021-01-21-at-15.08.39.png Screenshot-2021-01-21-at-15.08.39.png
    #158839 quote
    robertogozzi
    Moderator
    Master

    Your strategy is based on CCI crossings for exits only.

    It enters when there’s just a CCI peak.

    #158894 quote
    Philippo
    Participant
    Average

    Hi Roberto, that’s correct. Can you help explain why, in the purple circle in the image attached, there are two new down positions opened but in the chart “Backtest Variables” (where Entry up, Entry Down, Exit Up and Exit Down are displayed) there is zero value for Entry Down.

    I would expect each new entry position to be triggered by the Entry Down or Entry Up variable which is zero in the two cases identified on the chart attached, There should be no entries as far as I can see, but the system enters down on two consecutive occasions with no apparent reason.

    There must be either different price data or another trigger as yet unclear..

    Thanks 🙂

    #158900 quote
    robertogozzi
    Moderator
    Master

    Tell me what istrument, TF, date and time it is.

    #158903 quote
    Philippo
    Participant
    Average

    okay my bad…Only three of the variables were showing, for some reason I set the EntryDn variable to transparent. Often it helps just to explain to someone 😀 thanks.

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

ProOrder triggers different from Indicator


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Philippo @philipd Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Philippo
5 years, 1 month ago.

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