I am trying to write a pro-order strategy code, based around the inside bar.
I have looked online to try and help, but the assisted creation only seems to be able to get me so far, I can’t seem to progress any further. I have looked through previous strategies, but they are not helping.
Here goes…
For the inside bar to be valid, it must include the extreme wicks, so it is completely inside the previous candle.
Hourly chart, DOW.
No trades on Saturday or Sunday.
No time restrictions.
If an inside bar occurs, the strategy looks for certain conditions, to take, or not take, the trades.
Condition 1; if the price close at 23:00 today, is higher than the price close at 23.00 yesterday, then only a long position can be taken, off the inside bar.
Condition 2: if the price close at 23:00 today, is lower than the price close at 23.00 yesterday, then only a short position can be taken, off the inside bar.
Stop: 5 pips higher/lower, than the inside bar low/high including the wicks.
Target: Size of the inside bar, (including high/low wicks).
I have attached a chart as an example.
I don’t mind having a go with the code, if people give hints.
Indicator1 was my screener, that show yellow or blue candles, when it is an inside bar.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
DEFPARAMCumulateOrders=False
n=1
REM Définition du Harami
c1=high[0]<high[1]
c2=low[0]>low[1]
harami=c1andc2
CALL"INSIDE BAR"
c1=(close>indicator1)
IFc1THEN
BUY1PERPOINTATMARKET
ENDIF
tcondition=time>230000andtime<000000
IFharamiandclose<openandnotdaysforbiddenentryTHEN
buynsharesatmarketnextbaropen
ENDIF
IFharamiandclose>openandnotdaysforbiddenentryTHEN
sellshortnsharesatmarketnextbaropen
ENDIF
// Clôture
IFbarindex-tradeindex=1THEN
sellatmarket
exitshortatmarket
ENDIF
// Prevents the system from placing new orders on specified days of the week
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue