指定
I need to update my existing EA.
I describe existing features that were developed in EA for you to understand easily.
************************************************************************************************************************************************************************
PART 1: CREATE SIGNAL
1/ I want an EA that have following input parameters:
2/ When running, the EA looking is like this:
If RSI is below oversold level, mark it green. If RSI is above overbought level, mark it red.
3/ The alert works when it meets these conditions
The idea is that it only alerts/pushes notification if RSI is above the overbought level whereas symbol’s price is at upper band of Bollinger Bands (BB); and vice versa.
I describe the conditions in case BUY signal will be fired, SELL signal is opposite.
BUY signal fires when:
1. When RSI crosses oversold level, EA notices and checks BB until following conditions are met.
2. After there was a bull(green) candle formed up completely and BB lower band CUTS THROUGH that candle OR the whole candle is below BB lower band, EA fires alert.
3. The bull candle don't need to form right after RSI crossed level. When RSI crossed level, EA should remember and check BB continuously to find the right green candle.
These are some examples:
4/ It only alerts once when condistions are met. The alert only fires again if RSI goes back into oversold-overbought zone and crosses again
5/ The text in app’s notification looks like: <symbol>_<timeframe>_BUY/SELL
For example: EURUSD_M5_BUY GBPUSD_M1_SELL
PART 2: CHECK BREAKEVEN
I usually use hedge orders to cover losing order. I need to keep track if these orders are breakeven to close all.
For example: I buy 1 lot EURUSD order, after that I create another 2 lot EURUSD order if price decreases. I need EA tracks if the sum of these 2 orders is breakeven and notifies me via my app.
EA will sum all orders of a symbol including commission/swap to broker and anything to be sure that the sum of symbol’s orders is 0.
This alerts only initiated if there are more than 1 order of that symbol (>= 2 order)
EA will notify once time.
Text is: <symbol>_BREAKEVEN
For example: EURUSD_BREAKEVEN
************************************************************************************************************************************************************************
And these are features that I want to update in this project:
PART 3: SHOW SUM OF ORDERS
In EA table, add a column to show the total sum of all orders of each symbols, including commission & swap.
It is calculated as in the Checking Breakeven feature, but it shows number for easier monitoring.
PART 4: COUNT THE NUMBER OF LOT
I need to count the number of lot for all buy or sell orders of each symbol.
For example, I placed these orders of EURUSD:
+ Buy 1 lot
+ Sell 2 lot
+ Buy 4 lot
+ Sell 1 lot
Then, at EURUSD row,3 the BUY LOT column should be 5, SELL LOT should be 3
PART 5: AUTO PLACE ORDERS
I want to set multiple waiting orders and EA will place it in order that I set.
The idea is when I place 2 hedged orders, EA will create multiple waiting orders at the prices of those 2 orders to create a zone that if price go to upper/lower band, EA will place order to hedge the opposite orders. BUY order is only created if there was a SELL order placed right before it and vice versa.
So, we need to care about 2 things:
1. Order’s lot
2. Order’s price
---
The next BUY order’s lot = (parameter Z x total number of lots of current SELL orders) – (total number of lots of current BUY orders)
The next SELL order’s lot = (parameter Z x total number of lots of current BUY orders) – (total number of lots of current SELL orders)
For example,
+ parameter Z is 3 and 2
+ 1st order is Buy 1 lot, 2nd order is SELL 2 lot. Z is 3. Then the 3rd order is BUY with lot = 3 x 2 – 1 = 5. 3rd order is BUY 5 lot.
+ The 4th order is SELL with lot = (2 x (1+5)) – 2 = 10.
2. Order’s price
All next BUY orders have the same price as available BUY order
All next SELL orders have the same price as available SELL order
---
The parameters for EA: list of parameter Z, separated by comma.
Waiting orders’ lot are calculated consecutively
For example: Z = 2,3,1.5,1.5,3,3
1st order uses Z=2
2nd order uses Z=3
3rd order uses Z=1.5
---
*** Notice: all following actions are only initiated when there is the 2nd order placed opposite with 1st order of a symbol***
Then EA sets up all waiting orders (NOT pending orders, just virtual orders in EA) following above rules.
After setting up, EA should show table like this on screen
Symbol |
Buy/Sell |
Lot |
Price |
Action |
Buy |
1 |
1.2504 |
Delete | Edit | Move up/down |
|
Sell |
2 |
1.2564 |
Delete | Edit | Move up/down |
|
Sell |
2 |
1.4455 |
Delete | Edit | Move up/down |
|
GBPUSD |
Buy |
1.5 |
1.4646 |
Delete | Edit | Move up/down |
All waiting orders will be listed in this table.
In Action column:
+ Delete: delete that order
+ Edit: edit symbol, lot, price and buy/sell
+ Move up/down: to adjust the order
of that waiting order. I don’t know if there is more convenient way to move,
just suggest.
Orders of the same symbol are listed adjacently to each order. And in the order it was created.
---
Need a function to add waiting order manually
---
After those orders were set, the EA will work like this (independently for each symbol)
+ The order which was created first is placed as pending order.
+ If the 1st one was activated, the 2nd order is placed as pending order
+ And so on
Each time a pending order is activated, EA erases all SL/TP of available orders of that symbol.
There is always ONE pending order for each symbol which has waiting orders.
ALWAYS create pending order, DO NOT build the way that EA will automatically place position at the price of waiting order.
---
If there is no open order of that symbol anymore, EA should delete all waiting orders of that symbol