Hello, I’m new to PRT and just try to start with some basics. And….I just come up with some questions.
My intention is to enter the market with a long position as soon as the actual close is above the highest highs of the previous 5 bars. When my fist bar is January 1 does highest[5](high) mean the highest high of Jan 1 – Jan 5? Then I would put the actual close with the bar number 6 in front of it?
1
2
3
4
5
c1=(close[6]>highest[5](high))
IFc1THEN
BUY1CONTRACTATMARKET
ENDIF
Then I figured out that the opening will be always the next and not the current bar, but the ladder one is essential for me as I trade in daily bar mode. I reads somewhere there’s a way to use a limit order.
So my idea:
1
2
3
4
5
6
7
H1=highest[5](high)
c1=(close[6]>H1)
IFc1THEN
BUY1CONTRACTATH1Limit
ENDIF
Does I make work to trade at the current bar, as soon as the close price crossed the upper channel?
It is not possible to reference future data (candles/bars).
It is only possible to reference past data.
So whatever day or timeframe you are,
1
highest[5](high)
will always refer to the highest price of the LAST 5 bars, that is from HIGH[0] through HIGH[4]. If you want to refer to the LAST previous 5 bars you’ll have to write
1
highest[5](high[1])
Any code will be executed ONLY, as of this version of the platform, when each bar closes, whose high price may refrenced as HIGH[0] or just HIGH, then HIGH[1], and so on….
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.