CCI setup
Forums › ProRealTime English forum › ProOrder support › CCI setup
- This topic has 4 replies, 4 voices, and was last updated 7 years ago by
OscJoh.
Viewing 5 posts - 1 through 5 (of 5 total)
-
-
09/23/2017 at 12:53 AM #47027
Hello everyone
i am trying to write a simple setup using CCI
Everything is fine, except the exit orders…
i would like to close positions on the CLOSE of the bar on the first day in profit.
For now lets put a 5% stop
12345678910111213141516171819202122232425262728293031323334353637383940414243444546// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Conditions to enter long positionsindicator1 = CCI[72]indicator2 = Average[5](CCI[72])indicator3 = BollingerDown[21](close)c1 = (indicator1 CROSSES OVER indicator2)c2 = (close[3] > indicator3[3])c3 = (close[2] <= indicator3[2])c4 = (close[1] <= indicator3[1])IF c1 AND c2 AND c3 AND c4 THENBUY 1 SHARES AT MARKETENDIF// Conditions to exit long positionsc5 = (close > 0) ????????????????????????IF c5 THENSELL AT MARKETENDIF// Conditions to enter short positionsindicator1 = CCI[72]indicator2 = Average[5](CCI[72])indicator3 = BollingerUp[21](close)c6 = (indicator1 CROSSES UNDER indicator2)c7 = (close[3] < indicator3[3])c8 = (close[2] >= indicator3[2])c9 = (close[1] >= indicator3[1])IF c6 AND c7 AND c8 AND c9 THENSELLSHORT 1 SHARES AT MARKETENDIF// Conditions to exit short positionsc10 = (close > 0) ???????????????????????????IF c10 THENEXITSHORT AT MARKETENDIFThank you everyone
09/23/2017 at 10:53 AM #4704109/23/2017 at 11:22 AM #4704409/25/2017 at 1:36 AM #4717109/25/2017 at 7:55 AM #47176Some ideas:
Time based end of day exit (adjust to your market’s close)
1DefParam FlatAfter = 173000How to see if your current position is in gain, but it does not take transaction cost/slip into consideration as far as I know.
1IF PositionPerf(0) > 0.001 THEN -
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
Find exclusive trading pro-tools on
Similar topics: