To build a MT4 virtual straddle EA that is going to have the next inputs and the next interface on the mt4's chart: (explanations below in --The explanation of inputs-- and in --The Explanation of EA's Interface--) Inputs: LotSize=x Straddle=true/false Date=xx/xx Time=xx:xx:xx PointsAway=x* UseCancelSec=true/false CancelSec=x UseTP=true/false TP=x* UseSL=true/false SL=x* UseVSL=true/false VSL=x (in $) UseBE=true/false BE=x* UseTrailing=true/false Trailing=x* AutoClosing=true/false AutoClosingTime=xx:xx:xx AutoClosingDate=xx/xx CloseA=__** CloseB=__ UseTimeFrom=Broker/Local UseMaxDeviation=true/false MaxDeviation=x* * x is in points. 10 points=1 standart pip. A point is a 5th decimal point (3rd in JPY quotes). Except in VSL where it's in $, not in points. ** __ here the user can input the lot size for closing. (each input is explained below in --The Explanation of Inputs--) Interface on chart: The EA must have an interface on the chart of MT4. This interface must have the next buttons: Buy, Sell, CloseA [ ]***, CloseB [ ], BE, Cancel *** [ ] Here the user can see the number that was input in the inputs. (each button is explained below in --The Explanation of EA's Interface-- ) --The explanation of inputs-- 1. LotSize - The size of the lot. For example - 0.1 (minilot=10,000 units) 2. Straddle, Date, Time, Points Away - these inputs must execute as in the next example: Inputs: Straddle=true, Date=01/12, Time=15:30:00, Points Away=30 What happens: Exactly at the entered time and date 2 straddle lines appear on chart - Green line 30 points (3 standart pips) higher than ask price and red line 30 points lower than bid price. If ask price goes up and touches the green line a buy order is sent. If bid price goes down and touches the red line a sell order is sent. Immediately at the moment of touching both the straddle lines must be disabled and disappear, and must not appear again until the EA is removed from chart.**** MaxDeviation input must control the orders sent by the straddle lines. Straddle lines must have a certain interaction with Buy and Sell buttons of EA's interface. It is explained below in --The Explanation of EA's Interface--. **** Everywhere where it says "until the EA is removed from the chart" it is meant physicaly removed by the user. For example, If the platform was unexpectedly disconnected and then re-connected the straddle lines must NOT re-appear if beforehand they already were activated and disappeared. 3.CancelSec Must work as in the next example: Inputs: Time: 00:00:00 UseCancelSec=true CancelSec=15 What Happens: The straddle lines appear at 00:00:00 and exactly at 00:00:15 they disappear and disabled, and do not appear again until the EA is removed from the chart. 4.TP (take profit) Regular TP 5.SL (stop loss) Regular SL 6.VSL (virtual stop loss) The EA must close each opened position if its loss is X (in $) or more. Must be able to input less than a whole number. For example: 0.1 = 10 cents. 1.5 = $1.50 This function must work for any position separately, not for the general loss of all the opened positions. 7.BE (break even) When X points in profit then the EA will Move the SL to break even. 8.Trailing (Trailing Stop Loss) When X points in profit then the EA will Move the SL to break even and then maintain this distance behind current price (ofcourse only when the price is moving in the direction of the profit). 9.AutoClosingTime, AutoClosingDate Automatic full closing of the position at an entered time and date 10. CloseA, CloseB Those are inputs for the corresponding partial closing buttons that are on EA's interface. Example: Inputs: CloseA=0.5 What happens: The button on EA's interface shows "CloseA 0.5". When it is clicked then 0.5 lots from the existing position is closed. These buttons must NOT be able to open a position. They must only be able to close an existing position!***** *****When these buttons will be used only one trade with the current symbol will be present. Another parallel trade might exist but it will be with a different symbol on another chart with another copy of the EA. 11.UseTimeFrom Allows to choose which time is used for the EA's opperation - the broker server time or the local computer time 12. MaxDeviation It must clone the function "Enable maximum Deviation from Quoted price" that is found in the MT4's "new order window" of the brokers that offer instant execution (i.e. FXCM, FxPro etc.). This input must control sending of orders through straddle lines and also through clicking of buy and sell buttons on the interface (explanation of the buttons in the --The Explanation of EA's Interface--). Example: Inputs: UseMaxDeviation=true, MaxDeviation=20 What must happen: If the broker is unable to execute within the range of 20 points (2 pips) from the price that was sent then the broker offers a requote. --The Explanation of EA's Interface-- This interface must have the next buttons on MT4's chart: Buy, Sell, CloseA [ ]***, CloseB [ ], BE, Cancel The buttons must be located vertically on the right side of the chart. Each button must be sensitive to clicking on its whole area. 1.Buy and Sell buttons: They are clones of the platform's Buy and Sell buttons that are in the order window. MaxDeviation input must control them same as it controls the straddle lines. Buy/Sell buttons must have the next interactions with straddle lines: a.When the ask price goes up and touches the green line then the Buy button must be immediately disabled until EA is removed from chart. Exception: If the order sent by green line is not executed (requote) then the Buy button must be immediatelly re-enabled. b.When the bid price goes down and touches the red line then the Sell button must be immediately disabled until EA is removed from chart. Exception: If the order sent by red line is not executed (requote) then the Buy button must be immediatelly re-enabled. c. When Buy/Sell buttons are clicked then the green/red lines are immediately disabled and disappear, and do not appear again until EA is removed from chart. Exception: If the order sent by clicking the Buy button is not executed (requote) + if the ask price is lower than the green line's original level = the green line must re-appear and re-enabled on its original location. Exception: If the order sent by clicking the Sell button is not executed (requote) + if the bid price is higher than the red line's original level = the red line must re-appear and re-enabled on its original location. 2. CloseA [ ]*** & CloseB [ ] buttons: Buttons for partial closing according to the coressponding inputs. These buttons must NOT be able to open a position. They must only be able to close an existing position!***** *** [ ] Here on each button the user can see the Lot size that was input in its coressponding input in the inputs. ***** When these buttons will be used only one trade with the current symbol will be present. Another parallel trade might exist but it will be with a different symbol on another chart with another copy of the EA. 3. BE (Break Even Switch). If clicked it makes UseBE=True (if it was false) and immediately moves SL to break even (in case the input "BE" agrees). This button must work in any condition (when no position, when in loss, when in profit, before the time of the "time" input, after the time of the "time" input etc.). 4. Cancel When there's a click on this button the straddle lines are immediately disabled and disapear, and do not appear again until the EA is removed from the chart. --Additional Qualities-- 1. Log file EA must write to a log file how it entered a position - the time + whether it was the straddle or the click. The format must be hour:min:sec:milliseconds (this must be the broker or the local time - according to the inputs) example: 12:30:00:000 straddle 13:00:00:000 click 2. The EA must affect only the chart that it is put on. 3. The EA must manage any existing trade, no matter how it was opened (to manage it with SL, TP, VSL, BE etc.). -END-