Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 96
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
Are you sure you have all the braces. They are missing in some places. That's why your logic is flawed. And most likely the result is not what you expected.
Vitya, have you been away? I haven't seen you for a long time...
I was home today (almost).
Been home today (almost)
Are you sure you have all the braces. They are missing in some places. That's why your logic is flawed. And most likely, the result is not what you expected.
If you mean the code of the indicator, everything is ok there, the indicator works, gives signals in the form of arrows (for buy/sell-4 and 5 indicator buffers). But when I read these arrows from the indicator in the Expert Advisor, I get nonsense. I did not bring up the Expert Advisor completely because the main thing there is to understand how to read the signal and do the corresponding operation. In general, the problem is in reading the signal.
To paste the code correctly here, first click on SRC and then copy the code there.
If I understood you correctly, at a certain moment in time we have to open one OP_BUYSTOP and one OP_SELLSTOP ? Is it acceptable to have any other pending orders at this moment? For example, there are pending orders, but before opening a new one, the old ones should be deleted?
I have already pasted the generic code to make it clearer... At the end of the day I wanted to close all possible positions and orders...
and at the time of opening two pending orders (in the morning) there are no open orders or open positions before that, since they all have to be closed at a certain time in the evening. I wonder if my full order closure is at least correctly described? =)))
I honestly don't know the logic of your function. Whether it should delete objects or build them, I don't know. Tell me what you want it to do and we'll see where the logic is wrong. However, if the function tries to build a graphical object but fails, it means it already exists. What's the next logical step in your program? You can build a new object with a different name (for example, add the current time to the object name (TimeToStr(TimeCurrent()))) or, if you already have an object but need to change its properties, do not build it again, but simply change its properties. Then the error won't occur again.
It's simple. The main thing is to know what you want... :)
Actually, the function is merely a visual substitute for the print, it just displays everything on the screen. It is not written very well yet, but it works. :) I'll get there and rewrite it. And then you can think about the question that was.
By the way, if you don't build new objects, but modify the properties of existing ones, then again... It's going to be a headache. The idea is to display the last N shoals on the screen. If we always overwrite the outermost object, we could end up with only one object that has a particular bug. I could go further and select in a loop as many objects as I need and rewrite them only, but it's probably not worth the effort, since this function is only for testing and I'm not really bored with it since I already have too many things to do. Someday I will try the code of that function, and bring it to my senses, and then I can think about it!
A question has arisen. I am writing the following experiment. I have a bunch of orders that, naturally, open one after another based on certain signals. If the last order is closed, all other market and pending orders should be closed at all...
Of course, everything can be written through arrays, but I used an ordinary way. Here we go:
Condition:
we check if the last open order is closed! Then we start to delete the pending orders and close the market orders...
Here is the function itself, so there is no doubt that something is wrong with it(Criticism and comments are welcome, and even more than welcome :)) ):
If you're talking about the indicator code - everything is fine there with the brackets, the indicator works, gives signals in the form of arrows (for buy/sell - 4 and 5 indicator buffers). But when I read these arrows from the indicator in the Expert Advisor, I get nonsense. I did not bring up the Expert Advisor completely because the main thing there is to understand how to read the signal and do the corresponding operation. In general, the problem is in reading the signal.
Something like this.
Actually, the function is just a visual substitute for the print, but it displays everything on the screen. It's not particularly well-written yet, but it works... :) I'll get there and rewrite it. And then you can think about the question that was.
By the way, if we don't build new objects, but change the properties of existing ones, then again... That would be a headache. By idea, we need to display the last N-joints on the screen. If we always overwrite the last object, we could end up with only one object that has a particular bug. I could go further and select in a loop as many objects as I need and rewrite them only, but it's probably not worth the effort, since this function is only for testing and I'm not really bored with it since I already have too many things to do. Someday I will try the code of that function, and bring it to my senses, and then I can think about it!
This is yours: It should be like this:
Something like this.
thanks for the correction, but the algorithm didn't work correctly...