criteria for entering positions

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #107440 quote
    forexbull
    Participant
    Junior

    Does anyone know if it’s possible to enter trades based on the criteria of the prior closed candle?

    I’m coding a break out of daily lows via ATR multiples on a 2 hour chart. Most of the code seems to work OK but I’m stuck on one fundamental issue.

    At the moment I’ve only been able to work out the standard SELLSHORT 1 PERPOINT AT MARKET

    I would like to be able to enter a few points below the prior candle’s close.

    I can’t seem to find any code that replaces the standard MARKET.

    I was hoping it could just be replaced with CLOSE(1)-3.

    Thanks

    Andrew

    #107449 quote
    GraHal
    Participant
    Master

    What market ?

    Try below with square brackets (not rounded brackets)

    Easier for us if you post your full code?

    SellShort 1 perpoint at (close[1] - 3*pipsize) stop
    #107453 quote
    forexbull
    Participant
    Junior

    Thanks for the reply

    Here’s the code I’ve written for FOREX pairs. It’s a standard break out entry I use manually on daily charts.

    Technical analysis is carried out on the daily chart and an entry is made on a strong 2 hour candle.

    The manual system was designed to catch an intraday burst of break out strength over a day or so.

    I don’t have any experience in coding so I’m a long way off trying to automate my manual trading system.

    What I was trying to do was work out if it’s possible to enter a short position 3 pips below the close of a signal bar rather than just sell the market.

    No matter what I replace “market” with I get an error for the code. I did try your suggestion.

    Perhaps buy and sell the market is all the software can do?

    DEFPARAM CumulateOrders = False
    
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    c1 = (close < DLow(1))
    c2 = (high-close)>averagetruerange[10]*1.5
    
    IF c1 AND c2 and not daysForbiddenEntry THEN
    SELLSHORT 1 PERPOINT AT market
    ENDIF
    
    SET STOP pLOSS AverageTrueRange[14](close)*2
    SET TARGET pPROFIT AverageTrueRange[14](close)*2
    #107459 quote
    robertogozzi
    Moderator
    Master

    >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<

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

criteria for entering positions


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
forexbull @forexbull Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by robertogozzi
6 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/13/2019
Status: Active
Attachments: No files
Logo Logo
Loading...