
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
Here is my problem. This now shows me all active trades I have on each chart as I go through them but when I set the boolean to show all trades it displays all of them but the symbols are off. Again it will only display a max of 2 currency symbols. As you said this is down to the variables buysymbol and sellsymbol only containing one at any one time but I don't know how to get around this. I tried using arrays but since the symbols are letters not numbers I am running into some problems it seems.
You can have arrays of strings as well as other types.
Code fragment ...
Also get rid of the global strings buysymbol and sellsymbol now you are using arrays.
One other small thing I can't figure out yet is creating some space between the trades on screen. There strings that are responsible for displaying the trades. Here is an example.
I thought I could add a new line between trades by adding the + "\n" as shown below but it didn't have any effect at all.
Awesome Leslie I have it working pretty much perfectly now. I have added more input changes and Boolean statements to make it a bit more customizable too.
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?
Here is the how it looks with just one buy order active. Notice the line break above the order. Of course if I have more than one buy order open they stack up under that line break as well.
Ideally I would like it to appear in the same way sell orders appear i.e no line break
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.
As always I am really grateful for any suggestions you can give me dabbler :)
Seriously, thanks a lot for your kind effort to help me out here!
* Latest indicator attached below
I will have a look a bit later, for now I would make the general observation that the code is more difficult to read than it should be because it is not indented correctly. The indentation has absolutely no effect on the functionality but it is key to debugging code because the indenting helps you to see how the code functions. Let's take the init function. When everything lines up you can see it better. It may seem insignificant to you but it drives me crazy and I would need to fix it before reading on. Maybe its OCD, or maybe it's just coding discipline from years of experience.
should be
or I prefer it as
Look at this part ...
The final ObjectSetText is not associated with the final else. It would need braces to be associated with it.
So we have this error often
But it works because you are just duplicating the same instruction twice if the first test makes the first braces executed. In other words you execute both ObjectSetText commands!
Now we have ...
Which is mostly the same thing twice, and is easier to write and to maintain when written like this
This line (and another like it) is actually a bug.
ArrayResize(buys_list, nb);
The array size started off as 50. We are now shrinking the size to exactly fit the number of buy orders. But if the number of buy orders subsequently increases the program will crash by over-running the end of the array. All you need to do is delete these well intentioned but actually badly flawed lines.
Here's where we are to date, with the same functionality but cleaned up a little.