Apply Stop Loss and Take Profit to all Orders instead of Two Latest Opened Orders

 

Hi,

I have a script in which i want to make a change. This script apply Stop Loss and Take Profit to all of the Orders.


I want a change in it. It should apply Stop Loss and Take Profit to all Orders except of Two latest orders opened.

Extract profit down to the last pip
Extract profit down to the last pip
  • www.mql5.com
The article describes an attempt to combine theory with practice in the algorithmic trading field. Most of discussions concerning the creation of Trading Systems is connected with the use of historic bars and various indicators applied thereon. This is the most well covered field and thus we will not consider it. Bars represent a very artificial entity; therefore we will work with something closer to proto-data, namely the price ticks.
Files:
 
dfe864645: It should apply Stop Loss and Take Profit to all Orders except of Two latest orders opened.
  1. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
              No free help (2017)

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2018)

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
              No free help (2017)

  2. So add a counter. Increment when you find a valid order. Continue when below three. What's the problem?

Reason: