Auftrag beendet
Spezifikation
I wrote two indicators and need some help with checking out the code and adding some more features.
Fly price indicator calculates the distance between two spreads (EURGBP - EURUSD) and (EURUSD - GBPUSD) and plots this on a separate window as well as 10, 20 period moving average and 20 period bollinger band (adding and subtracting standard deviation from 20 period moving average).
Normalised Fly price plots normalised distance ( (distance-average)/standard deviation) and moving average of it.
I am a very beginner at coding and would like someone to check all the calculations and methods I wrote to make sure they both do as described above and rewrite codes in more efficient way where necessary.
Then I would like to add the following:
- A horitzontal line to the current indicator values which change as the values fluctuate. You will be able to see that I already attempted this.
- Display current fly price on the chart window (flyprice[0])
- Create variables that store current normalised values[0] of specific timeframe (5min, 15min, 1hour and 4hour) and display these on the chart
- Please have a look at the alert and notification function and change it so that it only alerts and notifies once when normalised value[1] of any timeframe(5min, 15min, 1hour and 4hr chart is greater or equal to 2 and less or equal to -2. Alert/notification must say which timeframe is alerting from
- Display x period standard deviation of each timeframe (5min, 15min, 1hour and 4hour) on the chart. x is an extern variable. For example if x = 3, compute (stdev[1] + stdev[2] + stdev[3]) / x for 5min, 15min, 1hour and 4hour and display these 4 average stdev on the chart window.
- 3,5 must have 5 decimal point
- Create two edit labels on the chart that takes in risk in USD and stop in pips and create a text label "lot to trade" that computes risk in USD/stop in pips
- Create an edit label that takes in lot to trade and a buy, sell, close button that executes ordersend(). For example, buy button buys (lot to trade) amount of EURGBP, (lot to trade) amount * 2 of EURUSD and (lot to trade) amount of GBPUSD at market price
- Create 4 text labels "Trade Type", "Open price", "Current price" and "Current P/L". Trade type prints Long if EURGBP was bought (i.e Long EURGBP, Short EURUSD, Long GBPUSD) and viceversa. Open price calculates at which price the spread is bought/sold (EURGBP - EURUSD) and (EURUSD - GBPUSD). Current price returns number 2, flyprice[0] and Current P/L computes Open price - Current price if trade type is Long or Current price - Open price if trade type is Short.
I want the labels on the chart to appear as the following: