Entry at second touch of EMA code?
Forums › ProRealTime English forum › ProOrder support › Entry at second touch of EMA code?
- This topic has 7 replies, 4 voices, and was last updated 5 years ago by GraHal. 
- 
	
		
- 
		
			
				
02/23/2020 at 4:09 PM #120237hi guys, I would like to know how to write the code which is when the price touch ema 2 times, then the entry position should be at the second touching point on ema. so anyone can tell me how to write? thank you so much 02/23/2020 at 6:03 PM #120239Wing Tai Tin – Welcome to the forums. Please try to post in the correct forum with future topics. The ProOrder forum is the place for auto strategy related questions. I have moved your post. 🙂 Also please use meaningful topic titles – I have changed yours. 02/23/2020 at 6:17 PM #120240Try this (not tested): 1234567LookBack = 10MyEma = average[20,1](close)// LONG exampleLongCond = (close > MyEma) and (low <= MyEma) and (summation[LookBack](low <= MyEma)[1])If LongCond And not OnMarket ThenBuy 1 contract at MarketEndif02/23/2020 at 6:28 PM #120241If you want to make sure price has also never closed below MyEma in the last LookBack bars, replace line 4 with: 1LongCond = (low <= MyEma) and (summation[LookBack](low <= MyEma)[1]) And (summation[LookBack](close >= MyEma) = LookBack)02/24/2020 at 6:00 AM #12025502/24/2020 at 6:52 AM #120256thank you for your helping but i dont really understand what is the difference between “longonmarket” “onmarket” “shortonmarket” also, “if” and “if not” for example: 
 if i want to entry buy position, i should
 1. if longonmarket/onmarket then or
 2. if not longonmarket/onmarket thenim so confuse how to use those codes. thank you very much 02/24/2020 at 8:15 AM #12025702/24/2020 at 10:24 AM #120271i dont really understand what is the difference between “longonmarket” “onmarket” “shortonmarket” Sounds like you need basic training? Have you ever coded before? It’s okay … I and many others on here hadn’t coded before we started using PRT . Try reading the PRT Manual and / or do Nicolas video course. https://www.prorealtime.com/en/pdf/probacktest.pdf https://www.prorealcode.com/programming-with-prorealtime/ 
- 
		AuthorPosts
			Find exclusive trading pro-tools on 




 
		 
		 
		