Problem with the most simple trading system

Forums ProRealTime English forum ProOrder support Problem with the most simple trading system

Viewing 9 posts - 1 through 9 (of 9 total)
  • #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

    #25080

    Hi Lollipop, you condition is either false or true- always.

    Try something like

     

    #25125

    Hello 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

    #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.

    #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
    GraHal

     

    #25146

    Aghh fingers to fast again! That should be …

    MA was above Bar 2 Open so this conditions triggered a Sell at Bar 3.

    #25147

    i try with a picture

    #25150

    Sorry but it that case the code would be:

    c1 = MA < open[1]

    right?

    Instead I am making the calculation on the actual bar with open[0].

    Thanks

     

    #25151

    When 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

     

Viewing 9 posts - 1 through 9 (of 9 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login