the job is in the title.
please see the attached file before reading.
1 - In the first column, we have the margin percentages for all symbols, whether monthly, weekly, or daily with one digit : 17.2 % = 100 * ( Account balance / (Account balance - won/loss this month, week or day ) ) -1
2 - In the second column number of points (indices) or pips (pairs) won/loss monthly, weekly and daily for the current symbol on the chart.
3 - in the third column, like in the first column but only for the current symbol on the chart.
4 - in the last line, named "Direct", we have the Risk / Reward of the current opened trade , the number of points/pips running, and the margin percentage . All for the current trade.
Risk/Reward= OrderProfit / ( Abs ( OrderOpenPrice-Order virtual stoploss) + spread + commission )
For all these values, a red color if negative, green if positive, and white if = 0
i wrote "virtual stop loss" because i often use stoploss below the STOP LEVEL, so please forget OrderStoploss() and use a virtual stop loss where position will close if Bid > or < "virtual stop loss".
i need a red line on the bottom of the chart, like on the capture. this red line will be abble to move by dragg and drop, to vsualize a stoploss.
So : 2 ways to buy / sell
* by choosing a stop loss level with the red line and clicking on the "Ligne" button. if the stop is below, it will buy, above it will sell, and virtual stop loss = red line level.
on orders, red line will disapear, replaced by a stop loss drawn like stairs when we 'll move stop loss with buttons.
* by clicking on "Achat" button or "Vente" button. in those cases, virtual stop loss will be placed up or under the hihgest/lowest of the last passed 3 candles + security. Same drawings for the stop loss, following candles. Security is a double input in order to avoid double top/bottom.
in all cases, when on position, red line disapears, and appears again when OrdersTotal=0
"+1" "-1" "+5" & "-5" buttons are for increasing or decreasing the stop loss in points ( indices ) or pips ( pairs ).
"B.E." : Break even including spread
"X" : closing current position
last thing : 3 inputs
* double : security
* int : margin of the account balance used in %
*double : Risk in % = % of Account balance depending on margin used, stop distance for each trade
for the number of lots : Math min ( input Risk(%) , available free margin )