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
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
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
>> 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! <<