backtest signals not matching the rules?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #194466 quote
    SwisspatrickSwisspatrick
    Participant
    New

    hi, I wanted to check a simple code and browsing through the chart, I realized buy signals, that shouldn’t have been triggered and I don’t see why it happened anyway.

    The following example is not a trading strategy, but simply to illustrate the buy signals.
    The idea is: buy, if the current bar’s OPEN is higher than the level of 3/4 of last bar’s range (in the bullish 1/4 of the last bar)

    c1= Open > High[1]-((High[1]-Low[1])/4)
    
    IF c1 then
    BUY 2 CONTRACT AT MARKET
    ENDIF
    
    SET STOP pLOSS 10
    SET TARGET pPROFIT 15

    quickly back testing this on the DAX in the M30 time frame, I found cases where it worked as designed (case 1), but I also found examples (case 2) where c1 was not met, but a buy signal was triggered anyway.

    Is there anything I am missing here or how come?

    setup.jpg setup.jpg 2-cases.jpg 2-cases.jpg
    #194497 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Try using parentheses in line 1, after “>”

    (High[1]-((High[1]-Low[1])/4))
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

backtest signals not matching the rules?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
4 years, 3 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/01/2022
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...