Pivot points

Viewing 10 posts - 1 through 10 (of 10 total)
  • #114271

    Festive greetings everyone. Can someone help please. Have been backtesting daily pivot points – a simple system; buy when close crosses over r1 or r2 and short when close crosses under s1 or s2. What I’m finding is that there are a number of trades that are coming up that don’t fit this criteria – for example a short trade is recorded even though it hasnt crossed s1 or s2 (in fact hasnt crossed anything!). I’m not sure what I’m doing wrong. Any suggestions?

     

    #114276

    It depends on how conditions are used when placing the order and at which point, in the strategy, they are used.

    If you post your code we might be of some help.

    #114322

    Much obliged Roberto. I’m still playing around with the code. I thought it maybe just something do with how I’m calculating the pivot points. looks like the issue occurs on Mondays. Code still in development:

     

     

    #114328

    I tried only LONG trades first, and it’s all good. As you can see from the attached pic, on the setup candle (where the mouse is sitting) there was a crossover compared to the previous candle, though it’s almost vertical and not horizontal. All other LONG trades confirm this correct behaviour.

    I suggest that you add GRAPH to monitor variables candle by candle, as in my code (slightly modified to enter LONGs only):

    it works fine for SHORT trades, as well.

    #114348

    Thanks Roberto, I’m still a bit confused about what you mean by ‘here was a crossover compared to the previous candle, though it’s almost vertical and not horizontal’ – apologies I’m still a beginner at this. Using your code above (long only) I tested against EURUSD and had some unexpected trades – seems Mondays only or midnight time. I think its do with the timing based on previous day/week that causes some sort of shift in the resistance/support levels maybe??? – I’m not sure really. See attached screenshots

    #114351

    Yes, but if you do not plot pivots on your chart I can’t see if there is a crossover or not.

    Look at my previous pic, there is a bearish candle where the mouse is sitting, then there is another bearish candle on its left. THAT is a bullish crossover!

    The previous candle closed BELOW the pivot line, the following candle (where the mouse is sitting)  closed ABOVE (despite il looks like on the right side) ABOVE the pivot line!

     

    #114352

    On Monday daily pivot lines will be calculated on the Sunday candle data. You need to ignore Sunday candles and use Friday data if it is a Monday and either include Sunday data with Monday data of ignore Sunday data if it is a Tuesday to get meaningful pivot lines. There is some code somewhere on this forum that does it or I have some code I wrote on one of my accounts – finding it might take a while though as I have not looked at pivot lines for years!

    #114358

    Here is some code that calculates R1, S1 and the central pivot and fixes the Sunday problem. On a Sunday and Monday it uses Friday data to calculate the lines. On Tuesday it uses Sunday and Monday combined to calculate the lines.

     

    #114359

    ah thank you both, splendid. Vonasi, do you know where I could find the code? I would really appreciate it. I could only find this? – https://www.prorealcode.com/reply/70436/

    #114360

    sorry Vonasi, just saw your previous message – many thanks! have a good weekend

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

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