Automatic trading last price

Forums ProRealTime English forum ProOrder support Automatic trading last price

Viewing 9 posts - 1 through 9 (of 9 total)
  • #189228
    MnA

    Hi,  I want to buy at market immediately as the live price crosses above the prior bar high.

    Sounds simple but when I use

    If Close crosses over  high [1] then buy position at market ….. the system waits until the current bar closes and then validates the command… I want the order to launch immediately as price moves above the prior high

    Can you guys help please…what is the correct coding word to get the system to send the order immediately as the live price goes above the high of the prior bar ?

    thank you

    #189240

    You can place  a STOP pending order:

    #189242

    Roberto is so busy helping folks with their coding problems that he forgot to say …

    BUY 1 Contract AT high[1] STOP //[1] gives prior bar high

    #189246

    I think he used [1] because he had to wait for the next bar to close before entering at Market. With a pending order, instead, he can place the order on the same bar whose HIGH is to expected be later crossed (while the next candle is forming).

     

    #189247

    Actually I am writing so many lines of code daily, that I sometimes happen to mistakingly write some code while thinking of prior posts. So any help or suggestion from whoever is highly welcome 🙂

     

    2 users thanked author for this post.
    #189248
    MnA

    Apologies, it is still not working…the current bar goes above the prior bar’s high…but does not send any order..It just waits for the bar to close…then it sends the order..I want the system to send the market order immediately .

    is this possible? thank you

    my simple code is below

    // Conditions to enter long positions
    indicator1 = close crosses over high[1]

    IF indicator1 THEN
    BUY 10 PERPOINT AT high [1] stop

    ENDIF

    SET TARGET PROFIT 10
    SET STOP PLOSS 10

    #189250

    Hi MnA, this could partly be a matter of how to judge what happens really. I mean, if I look at your screenshot in your last post, it seems to show what you want to happen. So without further context, would you agree that it shows all right (in a static picture) ?

    OK, maybe I just don’t get it (I *do* understand what you want to happen) … the blue line, including the little green triangle, shows fine – at the correct place. But where is that next bar of which you say that only “there” the trade happens ?

    Or did you draw this with MSPaint and does it only show what you want to happen ?

    #189254
    MnA

    Hi , the static image was to show what should happen… so… on current bar.. as it is forming…Buy at blue line (which is above the prior’s bar high).
    But the code seems to only send the order once the current bar closes not as it is forming ?… sorry Im confused.
    Thank you

    #189262

    You cannot enter with a STOP order AFTER high[1] is crossed over.

    Use a LIMIT order, instead.

     

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