Problem with the most simple trading system
Forums › ProRealTime English forum › ProOrder support › Problem with the most simple trading system
- This topic has 8 replies, 4 voices, and was last updated 8 years ago by
GraHal.
-
-
02/14/2017 at 7:08 PM #25077
Hello,
I feel stupid for this question because I can’t find the error even with the most simple trading system ever.
I want to buy when the open price is above the moving average and sell when is under, but as you can see from the picture is not working.
Thank you for support
02/14/2017 at 7:21 PM #25080Hi Lollipop, you condition is either false or true- always.
Try something like
1c1= close crosses over MA02/15/2017 at 9:17 AM #25125Hello Elsborgtrading,
thanks for answer, I am going to try your suggestion, but you are right, my condition is true or false, so why it opens a buy trade if the MA is over the price? By the way it should have open a short, right?
thanks
02/15/2017 at 1:06 PM #25142@Lol Yes you are right, it should have been SellShort.
Sell would often exit the buy position at the next bar, as you suspected 🙂
I often get stuck on ‘daft things’ also and instead of asking I bang, bang, bang my head against the wall for ages. I learn / teach myself in the end and it sticks in my mind that way, but I’m like a bear with a sore head while the angst is going on! 🙂 Much easier to ask, glad you did cos it meant I could help! 🙂
Let us know how you get on.
Cheers
GraHal.02/15/2017 at 1:19 PM #25143@Lol now I look again (in slower time) your code has correctly followed the logic, but as suggest, with a falling MA / below the open then maybe a SellShort might be more successful.
Looking at the 3 bars in the circle …
MA was below Bar 1 Open, so this condition triggered a Buy at Bar 2.
MA was above Bar 1 Open so this conditions triggered a Sell at Bar 3.Cheers
GraHal02/15/2017 at 1:30 PM #2514602/15/2017 at 2:26 PM #2514702/15/2017 at 2:34 PM #2515002/15/2017 at 3:05 PM #25151When a bar closes the conditions are checked so for example …
On a 1 hour bar and time NOW 13:00 … then MA < Open would be checked for MA < Open of the bar that ran from 12:00 to 13:00.
On a 1 hour bar and time NOW 13:00 … MA < open[1] would be MA < Open of the bar that ran from 11:00 to 12:00.
Note: On a 1 hour bar and time NOW 13:00 … Buy / Sell Orders triggered as above would be executed at (next bar open) START of the bar than runs from 13:00 to 14:00.
Hope that helps
GraHal -
AuthorPosts
Find exclusive trading pro-tools on