You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
There are 2 final small changes I would like to make. These are not a major changes at all just things I would like to get done before I can say it is completed.
First one is to do with the line break. When there are 1 or more open buy and sell orders on screen it looks great but when there is just 1 buy order on its own it is still visible and not needed. This is because the line break code tells it to appear above all buy orders.
The logic I need is to tell the indicator to display the line break only when there are 1 or more open buy and sell orders. When there is just 1 sell order open it doesn't appear and looks great because the line break code was only added to the code applying to buy orders. Any ideas on this?
...The next small edit I am hoping to figure out is the order display. As you can see below open orders are displayed starting with sell orders then a dashed line break and the buy orders. Is it possible to rearrange these so buys appear on top of the sells? This is not a big deal just something I would like to hear your opinion on because for all I know it might just be a straightforward code edit to do it.
The labels are numbered with 1 at the bottom left corner. By writing the buy orders first they appear at the bottom of the screen.
The line breaks are done within the buy order section. All that is needed is a test to only print them when there is also a sell order, ie ns > 0. It's trivial.
This bit is annoying me.
It is mostly duplicated code. The colour bit is easy to do but also doing the plus sign in the middle is messy. I can't seem to make it elegant in the sense of having a minimal number of tests whilst still being readable. Obviously the first res assignment can come out of the blocks as it is common.
It would probably look better if you said "Profit" when it is in profit and "Loss " when it is in loss, rather than having a negative profit.
Your earlier code looked like this ...
Your new code looks like this
which is messed up. The Order Volume for example isn't summing OrderLots.
It will be a lot easier to understand if you use 1 dimensional arrays rather than 2. Then you would have a hard job making errors like this :-)
I think you have a bit more work to do than you think.