automated trading – help with macd cross over 0 value
Forums › ProRealTime English forum › ProOrder support › automated trading – help with macd cross over 0 value
- This topic has 8 replies, 4 voices, and was last updated 6 years ago by Eric.
-
-
11/08/2017 at 5:45 AM #51883
hope someone can help me. It is possible that when you work with automated trade, you can program the following. example when macd cross over value 0, buy but first 10 pips up. or more exactly put an order 10 pips up when macd cross over 0 value. thanks in advance
11/08/2017 at 12:04 PM #519271234567891011once buytrigger=0MACDHist = MACD[12,26,9](close)if MACDHist crosses over 0 thenbuytrigger=close+10*pipsizeendifif buytrigger>0 thenbuy 1 contract at buy trigger stopendifif MACDHist crosses under 0 and buytrigger>0 thenbuytrigger=0endifHere you go.
1 user thanked author for this post.
11/08/2017 at 3:10 PM #51956Hi, im still trying to learn and was wondering what the buytrigger does?
Not sure what this means: Close+10*pipsizealso what does this do:
buy 1 contract at buy trigger stop // Did u mean buy 1 contract at buytrigger? What does the “stop” on the end do?
11/08/2017 at 3:32 PM #51958There should of course be written “buytrigger” in one word. It was separated by the autocorrect function of my computer and I did not read through what I wrote before posting, sorry for that.
Your other question I’m not sure about. The code does exactly what Amer asked for. When the MACD crosses over zero it put a buy order 10 pips above the close and keeps this level as buytrigger until the MACD crosses under zero again. I think all is correct besides the “buytrigger” which had a space in the middle. 🙂
11/08/2017 at 6:44 PM #5200111/09/2017 at 1:17 PM #521151234<span lang="en">a bit difficult to explain, but what I'm looking for is the same as currently available on automated trading inprorealtime. example macd cross over 0 value 10 periods ago. but in my case I'm looking for distance of 10 pips assbuytrigger insted of 10 periods ago.</span>11/09/2017 at 1:54 PM #5212711/10/2017 at 12:42 PM #5223311/10/2017 at 3:09 PM #52262if it dont work try change the name “buytrigger”
1234567891011once trigger=0MACDHist = MACD[12,26,9](close)if MACDHist crosses over 0 thentrigger=close+10*pipsizeendifif trigger>0 thenbuy 1 contract at trigger stopendifif MACDHist crosses under 0 and trigger>0 thentrigger=0endif -
AuthorPosts
Find exclusive trading pro-tools on