MA cross and DC line
Forums › ProRealTime English forum › ProOrder support › MA cross and DC line
- This topic has 5 replies, 3 voices, and was last updated 5 years ago by
Vonasi.
-
-
02/26/2020 at 6:11 PM #120596
Hi, Guys,
My trading strategy is using ma cross and DC line.
the entry and exit conditions are the following:
– When the ma50 cross over ma200 then entry long position and exit short position.
– When the ma50 cross under ma200 then entry short position and exit long position.Also, the DC up line is for adding more contracts in one direction trend. if the price high/low break DC up/down line, then entry position.
My programme code is the following
12345678910111213141516171819202122232425262728293031323334MA50 = Average[50](close)MA200 = Average[200](close)DCUP = DonchianChannelUp[100]DCDOWN = DonchianChannelDown[100]// Conditions to enter long positionsA = MA50 > MA200B = HIGH > DCUPIF A THENBUY 1 CONTRACT AT MARKETELSIF A AND B THENBUY 1 CONTRACT AT MARKETELSEENDIF// Conditions to exit long positionsIF MA50 < MA200 THENSELL AT MARKETENDIF// Conditions to enter short positionsC = MA50 < MA200D = LOW < DCDOWNIF C THENSELLSHORT 1 CONTRACT AT MARKETELSIF C AND D THENSELLSHORT 1 CONTRACT AT MARKETELSEENDIF// Conditions to exit short positionsIF MA50 > MA200 THENEXITSHORT AT MARKETENDIFThe problem is the entry position is not the same as my plan. so I don’t know how to solve this problem.
Thank you very mcuh.
02/26/2020 at 6:55 PM #120601Something typo
The exit conditions are when the price high/low breakout ma200.
02/26/2020 at 7:04 PM #120602Wing Tai Tin – Thank you for posting your strategy.
There are some simple rules that you are expected to follow when posting in the forums. One of them is to post your topic in the correct forum. The ProOrder forum is the correct place for your topic not the General Discussion forum. Another rule is that you should use the ‘Insert PRT Code’ button when posting code.
I will move your topic and tidy up the code but please try to post more carefully with future posts.
So far you have posted two topics in the wrong place, given one a meaningless title and failed to use the insert PRT code button in the other. It is not a great start! 🙂
02/26/2020 at 8:00 PM #120604If you want to use crossovers you should use CROSSES OVER and CROSSES UNDER instead of > and <, when comparing the two MA’s.
02/27/2020 at 7:01 AM #120637thank you, sir!!
but what’s the difference between “>”, “<” and cross over, cross under. I read the foundation pdf and but I still don’t really understand
02/27/2020 at 7:53 AM #120638< is less than.
> is greater than.
CROSSES UNDER and CROSSES OVER are exactly what they say – price in the candle started on one side of your value and closed on the other side of your value.
So the following are the same thing:
123if a crosses over b thenif a[1] < b[1] and a > b then -
AuthorPosts
Find exclusive trading pro-tools on