How to activate BUY/SELL at specific pivot point?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #82929 quote
    dunc1n
    Participant
    New

    Me again guys,

     

    Im looking for a very simple code to get me started understanding coding, and the language.

    To get me started, all I am after is a small code that BUYS (target 10 pips, stop 10 pips) when it comes DOWN from above and hits the daily pivot S1.

    I will be needing one that SELLS when it comes UP and touches the daily pivot R1 too, but Im hoping to do that one myself using the above code that I will hopefully get from you guys.

     

    Thanks guys

    #83047 quote
    Nicolas
    Keymaster
    Master

    The codes found in the topic below should give you some hints on how to make it:

    Automated trading with Pivot Points and Dojis

    Basic pivot point intraday trading strategy

    etc.

    Just ask if you are still in trouble to get things working! 🙂

    #83073 quote
    dunc1n
    Participant
    New

    Thanks mate, but Im still struggling.

    The codes are full of language that I dont understand. 🙁 This is why I was wanting some sort of newbies course that teaches you the basics. I have tried taking an existing code and altering it, but I have no idea what anything means.

    Everything seems to be crosses over, or crosses under!? All I require at the moment is how to write a code to trigger a BUY if the price hits a specific pivot point (lets say S2 for example).

    What would a basic code like this look like?

     

    Thanks guys

    #83089 quote
    Nicolas
    Keymaster
    Master

    The below code is a basic strategy, since you want to sellshort a price level that is above the current close, you need to set a pending LIMIT order at this price level:

    defparam cumulateorders=false
    
    Ht = DHigh(1)
    Bs = DLow(1)
    C = DClose(1)
    
    Pivot = (Ht + Bs + C) / 3
    //Res3 = Res1 + (Ht - Bs)
    Res2 = Pivot + Ht - Bs
    //Res1 = (2 * Pivot) - Bs
    //Sup1 = (2 * Pivot) - Ht
    //Sup2 = Pivot - (Ht - Bs)
    //Sup3 = Sup1 - (Ht - Bs)
    
    if not onmarket and close<res2 then 
     sellshort at Res2 limit 
    endif
    #83098 quote
    dunc1n
    Participant
    New

    Ok thanks, so I presume the first half of the code is programming in the pivot R2?

    But I’m just a little confused at the second part. What does the “onmarket” mean?

    Also, when you say I need to set a limit order, does the code do that for me? Or does it need to be set manually?

     

    Thanks again

    #83109 quote
    Nicolas
    Keymaster
    Master

    “not onmarket” means that we need no current order at market to set the new pending order. And yes, the code already set the limit order at line 16. We ask the broker to put a SELLSHORT (limit order type) at Res2 price.

    #83140 quote
    dunc1n
    Participant
    New

    Excellent thanks, so how do I set the amount per point and the stop?

    Also, how would you set the limit order to be like 2 or 3 pips BEFORE the R2?

     

    Thanks

    #83142 quote
    dunc1n
    Participant
    New

    Oh, one more thing…. How do I tell the system to only execute once per day i.e. once it’s triggered once (being win or lose), I don’t want it to execute the trade again for the rest of that day

     

    Thanks

    #83147 quote
    Vonasi
    Moderator
    Master

    A lot of answers can be found here:

    https://www.prorealcode.com/prorealtime-documentation/

    Also if you use the search box that appears if you click on the down arrow next to your avatar in the top right corner you will find that a lot of the questions you may want to ask have already been answered before – it can sometimes be much faster than waiting for an answer!

    #83159 quote
    Nicolas
    Keymaster
    Master

    how do I set the amount per point and the stop? Also, how would you set the limit order to be like 2 or 3 pips BEFORE the R2?

     

    sellshort 1 contract at Res2-2*pointsize limit

    A sellshort pending order of 1 contract, is set 2 points below the Res2 price level.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

How to activate BUY/SELL at specific pivot point?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
dunc1n @dunc1n Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by Nicolas
7 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/16/2018
Status: Active
Attachments: No files
Logo Logo
Loading...