How to Retrace?

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

    can anyone help me out here….

    I want to add to my code that the entry should not be on the open of the next bar according to the following code but only after the opening and after the price has retraced x number of points.
    How would I do this for a long /and short)?

    >IF (c1 AND c2) AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    thankyou!

    #196073 quote
    JS
    Participant
    Senior
    Once OpeningTime = 090000
    Once xPoints = 5
    Once PositionSize = 1
    
    If Time >= OpeningTime and Not OnMarket then
    HighRetracement = High - Close
    LowRetracement = Close - Low
    If HighRetracement >= xPoints and C1 and C2 then
    SellShort PositionSize contracts at Market
    ElsIf LowRetracement >= xPoints and C1 and C2 then
    Buy PositionSize contracts at Market
    EndIf
    EndIf
    

    Hi @deltasystem

    You can use:

    HighRetracement = High – Close

    LowRetracement = Close – Low

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

How to Retrace?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/23/2022
Status: Active
Attachments: No files
Logo Logo
Loading...