[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 132

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
IMHO, not complicated, but very easy to "direct" or send,
Well it's certainly easier to "send" i.e. "send" than to suggest. And in fact, I didn't ask anything so as to poke me in a textbook. Wrote a duplicate in one place, true, but the essence does not change.
Finally, tell me exactly what you want to do... For example: MAK so-and-so is going up and it is above MAK so-and-so and the price is at some point below/above MAK so-and-so and if it is true, then place a pending order at some distance. I will give you a rough algorithm. Because of all these code fragments, torn out of context, it's difficult to direct you in the right direction. After all the task is for the fifth grade (exaggeratedly)
Here I am attaching a test version of the code and publishing it in my post too.
The conditions clearly say that the price of the order is above (below) the MA+(-) offset from the MA.
Here it is:
The signal should only be calculated when the price is inthe "gap" area of the MA +(-) indent.
In a buy function, for example:
Buy must be abovefastMa byi_thresholdFromMa * pt.
In fact, it's not there. Either it's a fault in the language or it's a bug in the waving. How else can I explain what I need? I have given the whole code without additional conditions and functions (only one bare signal and opening).It's already written clearly(for a tester, I didn't check it for real!)
Here's how it opens:
Regardingthe highlighted: work on open prices, then there will be no MAs redrawing on the zero bar
I have a question - if I use a moving average with a shift to the right when I formulate my trading criteria - i.e. the shift value is positive.
Then when forming the signal I should not use the value of the moving average on the zero or the first bar, but on the bar with the index corresponding to the value of the shift.
The start flag of e.g. the fourth five minutes of each hour must be defined in the indicator.
I have a question - if I use a moving average with a shift to the right when I formulate my trading criteria - i.e. the shift value is positive.
Then when forming the signal I should not use the value of the moving average on the zero or the first bar, but on the bar with the index corresponding to the value of the shift.
Put the moving average on the chart and see what index you need. You can see it visually.
Well no doubt it's easier to "send" i.e. "send" than to suggest. In fact, I didn't ask anything to poke me in a textbook. I wrote a duplicate of it in one place, but the essence does not change.
Here I am attaching the test code variant and I am publishing it in my post too.
The conditions clearly say that the price of the order is above (below) the MA+(-) offset from the MA.
Here it is:
The signal should only be calculated when the price is inthe "gap" area of the MA +(-) indent.
In a buy function, for example:
Buy must be abovefastMa byi_thresholdFromMa * pt.
Actually it is not there. Either it's a bug in my language or it's a bug in my mouse. How else can I explain what I need? I gave a whole code without additional conditions and functions (only one bare signal and opening).It's already written clearly(for a tester, I didn't check it for real!)
Here's how it opens:
I deliberately made a condition on 1st bar, so there is no confusion. The main thing is how to run it...
For example: I want to place a pending order above/below a MA at a distance of ... bah, bah, bah, bah, bah, bah ...
For the second time, please explain, is it so hard? We would have solved your problem long ago.
Good afternoon.
Can you please advise how to deal with GAPs in EAs?
I often get GEPs during the weekend, and after they occur the work with the orders hangs, how to fix it, thanks beforehand!
Artyom, what do you think will work faster, expression with MathMax or with if?
I didn't explain in words, because it's clear that this expression serves me to avoid errors 130, and it serves me perfectly!
Thanks in advance!
Put the average on the chart and see what index you need. You can see it visually.
I did. I don't quite understand your answer, so I'll ask you again. Did I understand you correctly that when formulating the trading conditions
You should use the MA value for the corresponding number of bars backwards, but not the value marked with a yellow arrow in the picture.
I drew the figure as I understood your answer.