Help with Modify Stop Order

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #106699 quote
    everesttouch
    Participant
    New

    Dear all,

    I am new with prorealcode, can somebody help me to Modify a Stop order?

    For example: BUY 1 CONTRACTS AT x Stop. I want to change it from price ‘x’ to price ‘x+y’. And stop loss, take profit too.

    I have searched about this but got no luck. Then I tried to Cancel that Stop order and open with new order to work around but no luck too

    Can  somebody help me please

    Thank you in advance!

    jebus89 thanked this post
    #106701 quote
    jebus89
    Participant
    Master

    i belive what you want is something like this

    c1 = average[5](close) crosses over average[10](close)
    
    y = close - 50
    
    
    if c1 then
    buy 1 contract at y limit
    endif

    The buy condition is just an example. Point is that y = your price where you want to buy, which would be (price – 50).

     

    Im pretty sure im correct but if someone tells me im wrong im not gonna argue 😀

    #106702 quote
    Nicolas
    Keymaster
    Master

    You can’t modify a pending order, they last during one period. You have to continuously put them at market (on each bar) and change their price levels that way.

    #106703 quote
    GraHal
    Participant
    Master

    I want to change it from price ‘x’ to price ‘x+y’.

    Why don’t you post on here what code you have / use currently and state in words (or pseudocode) what you want the code to do and then you will likely get an amended version code by folk on here.

    Above will make it easy for us to help you. 🙂

    Nicolas thanked this post
    #106736 quote
    everesttouch
    Participant
    New

    Thank you @jebus89. But ‘buy 1 contract at y limit’ this y is fixed, right? I just want y can be modified, for example: Now I set it at price X but 10 minutes later if this pending order is not triggered, I can change the price to trigger to X+Y

    Thank @Nicolas. I see

    Hi @GraHal. I just want to change like this:

    For example: Now I set it at price X but 10 minutes later if this pending order is not triggered, I can change the price to trigger to X+Y

    This in MQL5 we can do easy. Hope prorealcode can support

    #106737 quote
    robertogozzi
    Moderator
    Master

    You can set Y to 0 initially, then increment it whenever some conditions of your are true, then clear it again whenever you want.

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

Help with Modify Stop Order


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 5 replies,
has 5 voices, and was last updated by robertogozzi
6 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/06/2019
Status: Active
Attachments: No files
Logo Logo
Loading...