BUY FXO Forum Shares
1327
Shares in the BANK:
We BuyWe Sell
$2.6263$2.7075
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 35

Thread: OCO Script [Order Cancels Order]

  1. #16
    Bullish
    Join Date
    Aug 2009
    Posts
    67
    FXO Shares
    0
    FXO Bonus
    0.240
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry, for bothering you. But, I would like to hear your opinion or what do you think.
    There is a value which has to be entered inside OCO_Visual - TP and LS. Do you think its value should be entered in pips or prices?

  2. #17
    Market Maker ilearn2t's Avatar
    Join Date
    Sep 2008
    Location
    In my house
    Posts
    2,475
    FXO Shares
    0
    FXO Bonus
    2.756
    Thanks
    386
    Thanked 211 Times in 159 Posts

    Default

    Quote Originally Posted by alex198555 View Post
    Sorry, for bothering you. But, I would like to hear your opinion or what do you think.
    There is a value which has to be entered inside OCO_Visual - TP and LS. Do you think its value should be entered in pips or prices?
    Hello alex198555

    The EA attached is far from complete but it will give you something to play around with, on the demo board or if you prefer open a new platform cencel the signup and use the backtests without server connection.

    Please read the text message in the zip folder before setting the exe file.

    Attachment removed by ilearn2t (no longer needed)
    Last edited by ilearn2t; 03-24-2010 at 04:36 AM.

  3. #18
    Bullish
    Join Date
    Aug 2009
    Posts
    67
    FXO Shares
    0
    FXO Bonus
    0.240
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the assistance.

    Can you explain the code, please?

    OP_BUY - Buy_Pending - 0
    OP_SELL - Sell_Pending - 1

    OP_BUYLIMIT - Buy_Pending - 2
    OP_SELLSTOP - Sell_Pending - 5

    OP_BUYSTOP - Buy_Pending - 3
    OP_SELLLIMIT - Sell_Pending - 4
    What are those numbers (0,1,2,3,4,5)?

  4. #19
    Market Maker ilearn2t's Avatar
    Join Date
    Sep 2008
    Location
    In my house
    Posts
    2,475
    FXO Shares
    0
    FXO Bonus
    2.756
    Thanks
    386
    Thanked 211 Times in 159 Posts

    Default

    Quote Originally Posted by alex198555 View Post
    Thanks for the assistance.

    Can you explain the code, please?



    What are those numbers (0,1,2,3,4,5)?
    Hello alex198555

    I've just tested the EA on AUDUSD (see image "comment") that will also answer a request you asked in an earlier post about "comment" on platform.

    Image "code" show my buy setting as 0.9170 & sell 0.9162 to get the order(s) to open at that price I set (image "c1") Buy_Pending at "0" the platform system recognises this as a buy order and the Sell_Pending at "1" same reason.

    Because both orders at not pending orders once file was placed I moved the setting closer to trigger point.

    The price while setting the orders was 0.9165

    Update: Must sign off now, speak later.
    Last edited by ilearn2t; 03-23-2010 at 08:59 AM. Reason: Updating

  5. #20
    Bullish
    Join Date
    Aug 2009
    Posts
    67
    FXO Shares
    0
    FXO Bonus
    0.240
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The, I shouldn't change the "0" and "1" numbers, right? Otherwise, there will be a mistake!

    Listen, I still didn't get how you write comment for each trade?

  6. #21
    Market Maker ilearn2t's Avatar
    Join Date
    Sep 2008
    Location
    In my house
    Posts
    2,475
    FXO Shares
    0
    FXO Bonus
    2.756
    Thanks
    386
    Thanked 211 Times in 159 Posts

    Default

    Quote Originally Posted by alex198555 View Post
    The, I shouldn't change the "0" and "1" numbers, right? Otherwise, there will be a mistake!

    Listen, I still didn't get how you write comment for each trade?
    Hello alex198555

    It depends on what kind of orders you want to set.

    But the EA is only to get you use to setting different price ranges.

    To go back to the first request.

    I believe we need 2 EA's one that places buystops & sellstops and the other that places buylimits & selllimits but still retain the right to choose your own price and delete as OCO.

    The "comment" is mostly used by traders with different EA's on multiple charts to identify each EA, but if you look at the image below you can write what you want if the string comment is added to your inputs box (to follow in next upgrade)

  7. #22
    Bullish
    Join Date
    Aug 2009
    Posts
    67
    FXO Shares
    0
    FXO Bonus
    0.240
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The another question. I think it's better to modify an OCO script a little bit. Create an column where a trader can write some comments like entries. Once, the OCO script will be executed., a trader can see those comment in MT4. Is it possible?

  8. #23
    Market Maker ilearn2t's Avatar
    Join Date
    Sep 2008
    Location
    In my house
    Posts
    2,475
    FXO Shares
    0
    FXO Bonus
    2.756
    Thanks
    386
    Thanked 211 Times in 159 Posts

    Default

    Quote Originally Posted by alex198555 View Post
    The another question. I think it's better to modify an OCO script a little bit. Create an column where a trader can write some comments like entries. Once, the OCO script will be executed., a trader can see those comment in MT4. Is it possible?
    Hello alex198555

    Don't think thats possible after trade is executed, you can type in the comment box manually and see it on your order.

  9. #24
    Bullish
    Join Date
    Aug 2009
    Posts
    67
    FXO Shares
    0
    FXO Bonus
    0.240
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Then, if I create them manually like two pending orders for buy and sell. Later on, one of them will not be canceled. That is the problem

  10. #25
    Market Maker ilearn2t's Avatar
    Join Date
    Sep 2008
    Location
    In my house
    Posts
    2,475
    FXO Shares
    0
    FXO Bonus
    2.756
    Thanks
    386
    Thanked 211 Times in 159 Posts

    Default

    Quote Originally Posted by alex198555 View Post
    Then, if I create them manually like two pending orders for buy and sell. Later on, one of them will not be canceled. That is the problem
    Hello alex198555

    Yes, until we program the 2 EA's you will have to delete manually. And even after that you'll have to keep your platform connected while trades are pending or the EA(s) won't work.

  11. #26
    Market Maker ilearn2t's Avatar
    Join Date
    Sep 2008
    Location
    In my house
    Posts
    2,475
    FXO Shares
    0
    FXO Bonus
    2.756
    Thanks
    386
    Thanked 211 Times in 159 Posts

    Default

    Hello alex198555

    This upgrade is still only in demo testing format, no delete added.

    I have removed the unwanted stuff from inputs to make it easier to use.

    No need for 2 EA's, if you want to place Buystop & Sellstop orders at your own price chance the Value's in the buy/sell boxes. If you want to place Buylimit & Selllimit change the true Value in the StopOrder box to false and change the false Value in the LimitOrder box to true. Simply double click on the true type in the StopOrder box and change the settings from the drawdown box same for LimitOrder. Remember to place the decimal point in the right place when changing price values.

    Eg:
    USDJPY 91.83 = 91 (decimal point) 83
    GBPUSD 1.4984 = 1 (decimal point) 4984

    Back later with next upgrade.

    ilearn2t removed attachment no longer required.
    Last edited by ilearn2t; 03-25-2010 at 11:03 AM. Reason: Attachment removed

  12. #27
    Market Maker ilearn2t's Avatar
    Join Date
    Sep 2008
    Location
    In my house
    Posts
    2,475
    FXO Shares
    0
    FXO Bonus
    2.756
    Thanks
    386
    Thanked 211 Times in 159 Posts

    Default

    Hello alex198555

    Early results with Delete added. ( See images)

    Image "place" forward testing
    Image "after" shows buy order triggered and sellstop deleted.
    Image "backtest" is backtest showing once one pending order opens the other deletes.

    The "Delete" upgrade will be posted here later.

  13. #28
    Bullish
    Join Date
    Aug 2009
    Posts
    67
    FXO Shares
    0
    FXO Bonus
    0.240
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nice work! Please, keep it up!

  14. #29
    Market Maker ilearn2t's Avatar
    Join Date
    Sep 2008
    Location
    In my house
    Posts
    2,475
    FXO Shares
    0
    FXO Bonus
    2.756
    Thanks
    386
    Thanked 211 Times in 159 Posts

    Default

    Hello alex198555

    EA completed.

    Remember this EA was programmed to show how to automatically place OCOs at the price of the traders choice including stoploss & takeprofit level and once one order is triggered the opposite order is deleted. Any member unfamiliar with placing Stop/Limit orders will find this EA useful on a demo account in learning how to place such orders.

    Few tips.

    Buystops must be above current market price and equal or above Brokers minimum limit.

    Sellstops must be below current market price and equal or below Brokers minimum limit.

    Buylimits must be below current market price and equal or below Brokers minimum limit.

    Selllimits must be above current market price and equal or above Brokers minimum limit.

    When changing the price value(s) remember to place the decimal point in its proper place.

    Testing Stop orders requires Stops = true - Limits = false.

    Testing Limit orders requires Stops = false- Limits = true.

    Testing more than one currency pair requires Magic1 & Magic2 to have completely unmatched numbers placed (any number(s) will do as long as none match)

  15. #30
    Bullish
    Join Date
    Aug 2009
    Posts
    67
    FXO Shares
    0
    FXO Bonus
    0.240
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks. Are you sure that it is completed one and there is no bugs. I mean if I can use it?

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Disclaimer
2005-2016 © FXOpen All rights reserved. Various trademarks held by their respective owners.

Risk Warning:: Trading on the Forex market involves substantial risks, including complete possible loss of funds and other losses and is not suitable for all members. Clients should make an independent judgment as to whether trading is appropriate for them in the light of their financial condition, investment experience, risk tolerance and other factors.

FXOpen Markets Limited, a company duly registered in Nevis under the company No. C 42235. FXOpen is a member of The Financial Commission.

FXOpen AU Pty Ltd., a company authorised and regulated by the Australian Securities & Investments Commission (ASIC). AFSL 412871ABN 61 143 678 719.

FXOpen Ltd. a company registered in England and Wales under company number 07273392 and is authorised and regulated by the Financial Conduct Authority (previously, the Financial Services Authority) under FCA firm reference number 579202.

FXOpen does not provide services for United States residents.

Join us