指定
Requirements:
Create a Trading pad with few input box/ push buttons, all encapsulated within a moving box so that, its position can either be moved anywhere on screen or minimised when not in use. Design of trading panel will be discussed after we agree to go ahead.
** EA will be considered as Complete after it is designed, tested with all the logics mentioned/discussed, using live and demo account and delivered with original code.
Design an EA that will do following tasks in mentioned order:
Once EA is put on a chart, it should have initial position size entry which will be used to take 1st trade when one of the conditions are met using RSI readings
When EA is attached, and RSI reading goes above (value High) which will be again part of EA settings, program should enter a trade after a candle is closed and RSI reading is above (value high) and stop loss should be Point A till no pending orders are activated. Once one of the pending order is activated, stop loss should be moved after calculating level based on Stop loss percentage.
Same goes for Sell trades, when RSI reading is below ( value Low) EA will enter a sell trade after candle close.
Note: Risk management logic for open trades is still applicable for this entry which is entered before any of fib trades is activated.
Pending Orders:
1. Have the ability to choose Point A and Point B based on mouse click or some other method, instead of manually typing. These points would generally be candle high/low depending on direction of trade. So there should be 2 input box on screen, when clicked on First input box, and then clicked on the candle, EA should pick the bottom or top of candle depending upon direction of trade, same goes for Second input box.
2. Based on 2 given price points, Point A and Point B, decide direction of trade, for example, if Point A is less than Point B, then direction would be 'Buy'.
3. Based on defined logic, create pending orders in the direction of trade at calculated levels based on Point A and Point B. These levels will be calculated as fib percentage levels (input box on the panel will store 6 different fib levels). There will be minimum of 6 pending orders created once levels are defined.
4. Input box to enter the Stop loss percentage. This stop loss percentage would be based on Point A and Point B defined above. For ex. if Point A is 0.8700 and Point B is 0.8800 and Stop Loss percentage box says 120% , so the 120% of pips between Point A and Point B calculated and subtracted from Point B or 20% pips subtracted from Point A ( either way) should result in the Stop loss for all the pending orders created in Step 3.
5. There will be another input box on Screen with Take Profit percentage, which will be calculated in similar way as Stop Loss logic.
Risk Management:
Position Size:
1. There should be an input button to define risk in $ amount. This amount will be based on account currency and not in USD.
Once the Entry level is known, stop loss level is known, risk per trade is known, position size should be easy to calculate.
Amount of risk per trade will be calculated based on a separate logic which will be discussed when final spec is delivered.
2. As and when pending orders get triggered, there should be a logic in program to manage open positions. When more than 1 pending order is activated, program will look to close all but most recent active order, so for example, if Pending Order 1 ( P.O.1) is active, and then P.O.2 becomes active, program should close P.O.1 at break even after calculating commissions/swaps. Similarly, if P.O.1 , P.O.2 , P.O.3 and P.O4 are active, program should calculate break even point for P.O.1 , P.O.2 and P.O.3 and close these 3 trades and keep P.O.4 active.
3. Once Point A level is broken after trades are active, then program should close all the trades for break even before market reaches Stop Loss level.
4. There should be a button on the panel with 'Flat' option which will delete all the pending orders for the currency pair it is running and for the timeframe it is running and close all the active orders for same currency pairs on that timeframe.
5. Idea is to run the EA on same or different currency pairs on 1 or more timeframes simulaneously. So, for example, EA can be running on EURUSD H4, EURUSD M5, EURUSD Daily, USDJPY M1 , USDJPY H1 etc at the same time, so each set of trades should be treated individually.
6. Program should be able to calculate the pip value for each instrument and then decide on the position size, for example, EURUSD will have a different pip value, Gold will have different, USOIL will have different etc.
7. Once a trade is active and price moves past Point B, other pending orders should be deleted for that pair and timeframe and stop loss should be moved from defined fib level to break even ( after calculating commissions / spreads/swaps ).
8. If price moves above Point B without tagging any pending order, then all the pending orders should be deleted.
Summary:
Idea of this whole exercise is to make sure, when direction is confirmed, 1 active trade is running unless stop loss is hit. In this whole exercise , maximum of 7 trades will be executed before stop loss is hit and once more than 1 trade is active, EA should be closing all the open trades but 1 unless invalidation level is hit which will be Point A and in that case, idea is to run for cover and close all the trades for break even before Stop loss level is reached.