Automated trading with Pivot Points and Dojis

Forums ProRealTime English forum ProOrder support Automated trading with Pivot Points and Dojis

Viewing 15 posts - 1 through 15 (of 85 total)
  • #69975

    Hi everyone,

    I’m new to this community and I would like to develop a code for automated trading within ProRealTime with Pivot Points and Dojis as triggers. That system should be able to automatically execute a trade when a doji (or a different reversal pattern) appears at a S2 or R2 pivot line. These patterns could occur within a specific distance to the S2 and R2 line (e. g. 10 – 20 points when trading the DAX). It should sell at the R2 and buy at the S2 line. Furthermore the exit of the trade should be on the close or on the first open of a candle that makes a lower low after a prolonged uptrend, or on the first higher high after a downtrend.

    The potential markets I want to trade are DAX, DOW JONES and EUR/USD.

    Any help is highly appreciated!

    Thank you very much;)

     

    #69997

    It reminds me of this code I made as a scanner: Doji entry scanner

    Could be easily converted to an automatic trading program. Someone? 😉

    1 user thanked author for this post.
    #70001

    I’m sure it can be improved, ideas anybody?

    Feel free to change / add code etc?

    All credit goes to Nicolas as it’s his Scanner quickly converted to an Auto-System.

    1 user thanked author for this post.
    #70005

    Wow, that is pretty awesome, thank you very much!:)

    Does the code automatically consider my Pivot Point time frame? Where can I adjust the distance from the dojis to the R2 and S2 line?

     

    #70007

    All credit goes to Nicolas as it’s his Scanner quickly converted to an Auto-System.

    I was in from jobs in the garden having a coffee and saw Nicolas post.

    So no, it’s not tailored specifically  to your System specification. I just thought it might get you going and save Nicolas some time! 😉

    Oh well … back to my summerhouse painting! 🙂

    1 user thanked author for this post.
    #70010

    Thank you Grahal, I was in my swimming pool, that’s why I didn’t code the strategy and asked a mate to code it for me 😆

    I hope you enjoyed the sun today!

    2 users thanked author for this post.
    #70100

    Thanks again!:) I really tried to adjust the code to do the following tasks:

    1. It should only place a trade if the first candle after the doji closes higher or lower than the high or the low of the doji, this depends wether it is a buy or a sell.
    2. It should place a stop at the high or the low of the entry doji.
    3. It should get out of a position (set target) right after a candle closes below the low of a previous candle in an uptrend and vice versa in a downtrend.

    I’m really not sure if it will work like I wanted it to do.

    Thank you!;)

     

    #70229

    Hi,

    sorry to bother you guys again! I made a few changes to the code but for some reason the stops and the exits do not work.

    Do you have any idea why that is?

    Thank you so much! 🙂

     

    #70238

    Is it because you set the Stops within If statements and so conditions (other than price level) have to be met to trigger the stop?

    Normally it would be price level ONLY that would trigger Set Stop PLoss xx ?

    #70274

    Thank you! If you delete the conditions “bullish” and “bearish” within the statements, then the stops are working:) Is there also a way to exit the trade immediately when hitting a specific resistance or support line and not just when the next new candle begins?

    #70275

    Yes but first you would have to code the Supp or Res Line into the System.

    You could use Alerts and then pick off one of the horizontal default PRT Supp / Res line conditions (see attached) or set your own price level line.

    Make sure you get that drop down box set correct on the red arrow  … read up on the optional settings.

    1 user thanked author for this post.
    #70288

    So far the performance is not bad as you can see in the attached picture. But the exit strategy when hitting the next pivot line does still not work. It should have stopped out as soon as the candle in the red first circle of the first picture was touched, but the exit was made in the second red circle because of the end of the trading day. For example for the case when a doji forms within a range of 4 points next to the R1 line and is supposed to exit at the pivot line, the code looks like this:

    And the second Problem is, that I’m not even sure if the trade is only triggered when the doji is within the range of +- 4 points, because when you take a look at picture number 3 I don’t understand why it sold 1 contract short. There is no pivot line close to it.

    Is it because the code is not right?

     

    Thank you so much for your help!!:)

    #70292

    IF shortonmarket then SET TARGET PROFIT pivot

    So taking one step at a time, are you saying that the Piv T Line equates to Pivot in your code?

    See attached … and that is why you expected to ExitShort as price had reached Piv T / your code pivot??

    1 user thanked author for this post.
    #70295

    Yes that is what I was thinking. I thought, that the calculated pivot lines from the code should be the same as the pivot lines from the indicators.

    #70298

    Right let’s slow this down a bit! 🙂  Which I don’t do when I’m working on my own Systems! 🙂 If something doesn’t jump right out at me, I move on and let it knaw away at my subconscious and often when I wake up the answer is there! 🙂

    Where does the T come from in Piv T?

    I can only get it to show Piv D (for Daily) of Piv for less than 1 day (e.g. 15 mins).

Viewing 15 posts - 1 through 15 (of 85 total)

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