[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 137
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
At the moment the task is as follows: fastMa has crossed slowMa upwards... so we are looking for where to buy. Then we wait until the price i.e. Ask (since we consider buying) reaches fastMa ( well, I guess there will be no exact value, we need +- some deviation, and this is changed by i_thresholdFromMa) and as soon as the price reaches fastMa +- i_thresholdFromMa the Expert Advisor should set BUYSTOP at (fastMa + buyHear * pt).
What I have come up with does not work in one terminal and does not always work in another one. Something is wrong in general.
The last variant of the buyHear function here:
Here are the input parameters:Errors can be seen on the screenshot (in OrderSend() the price is fed above the red wand, and the order as seen on the screenshot is below....):
Been away for a few days... I'm wondering - do the same parameters have the wands thrown onto the chart as the wands used in the calculations? Maybe that's where the dog is buried?
(I still had no time to delve into the code and take it apart).
I would make a function, for example:
and call it to get the parameters
Hello, could you please advise! An indicator signal to buy has triggered, I open an order only after confirming the next two candles upwards.
Hello, could you please advise! An indicator signal to buy has triggered, I open an order only after confirming the next two candles upwards.
So check that the last two candles up and the condition to open an order two bars ago at the same time.
So check that the last two candlesticks up and the condition to open an order two bars back at the same time.
how do I do it?
And if so, the signal is triggered wait for confirmation, only after a bar up or down 2 bars.
We need it to remember the bar on the signal, the bar after the signal, compare them if the two are ascending or descending, then .....
how do I do it?
If the signal worked, we wait for confirmation, but after the bar goes up or down.
It should remember the bar on the signal, the bar after the signal, compare them if the two are ascending or descending, then .....
how do I do it?
If the signal worked, we wait for confirmation, but after the bar goes up or down.
It should remember the bar on the signal, the bar after the signal, compare them if the two are ascending or descending, then .....
I am writing a simple Expert Advisor and run into a lot of problems.
The condition is
I remember the close price of the current bar and enter it into the variable Startprice if the previous 4th bar was in the sliding bar.
If the condition is satisfied, then draw an icon showing the close price of the bar, i.e., Startprice.
What I have got is that the icon is drawn, but only once, while I need it every time.
The close price of the bar does not coincide with the Startprice price at 0.00001 why and how do I fix it?
Tried rounding and trimming to 5 digits did not help(
In the log using the print I call the value Startprice, shows the number only up to 4 digits and less.
How to achieve the same accuracy as in the data window of the terminal?
This decimal point problem also applies to the slider itself. If you call its values via print, you can't get more than 4 digits in the log.
Use DoubleToStr(number, Digits) for output. Instead of Digits you can write the accuracy you want. Add to the icon name the time of the bar at which you are setting the icon.
if so
it's not working, it's blaming '=' - incompatible types C:\fortest\experts\sve.mq4 (34, 14)
How do I write it correctly?
Thanks for the reply, I've been struggling with this for a week )
Use DoubleToStr(number, Digits). You can write the precision you want instead of Digits. Add the bar time to the name of the icon where you are setting the icon.
but for the output, I understand that the printer only prints 4 or less digits.
then if Print (DoubleToStr(Startprice,5)); // print Startprice
it gives out 5.
But here's how to add the time of the bar.
This line does not add the time of the bar?