how to code takeprofit and stoploss?
Forums › ProRealTime English forum › ProOrder support › how to code takeprofit and stoploss?
- This topic has 9 replies, 3 voices, and was last updated 7 years ago by CHIFHE.
Viewing 10 posts - 1 through 10 (of 10 total)
-
-
07/01/2017 at 3:29 PM #3954607/01/2017 at 4:38 PM #3955407/01/2017 at 6:16 PM #3955807/01/2017 at 6:38 PM #39562
grahal, i am still having an error on my program, can you please assists
12345678910111213141516171819202122232425262728293031323334353637// Conditions to enter long positionsindicator1 = Cycle(close)c1 = (indicator1 CROSSES OVER -20)indicator2 = CCI[20]c2 = (indicator2 CROSSES OVER -100)indicator3 = Cycle(close)c3 = (indicator3 CROSSES OVER 0)IF c1 OR c2 OR c3 THENBUY 2 CONTRACT AT MARKETENDIF// Conditions to exit long positionsSet stop Pprofit 250Set stop ploss 250endif// Conditions to enter short positionsindicator5 = Cycle(close)c5 = (indicator5 CROSSES UNDER 20)indicator6 = CCI[20]c6 = (indicator6 CROSSES UNDER 100)indicator7 = Cycle(close)c7 = (indicator7 CROSSES UNDER 0)IF c5 OR c6 OR c7 THENSELLSHORT 2 CONTRACT AT MARKETENDIF// Conditions to exit short positionsSet stop Pprofit 250Set stop ploss 250ENDIF07/01/2017 at 9:33 PM #39565You’ve got two IFs and 4 EndIfs … is that the problem?
Also please use the <> Insert PRT Code button to add code to this page as then your code will be formatted and also in colour and will then be so much easier to read 🙂
1 user thanked author for this post.
07/03/2017 at 9:21 AM #3964607/03/2017 at 12:05 PM #3967507/03/2017 at 12:51 PM #3968107/03/2017 at 1:25 PM #3969107/03/2017 at 1:50 PM #39698 -
AuthorPosts
Viewing 10 posts - 1 through 10 (of 10 total)