[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 143
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
On a fractal! I tried it with a stop-loss - it sucks, I would like to try it with stops on fractals, but I don't know how to write it in the condition. Or how to write it in an EA, I have written an entry condition, something like this
if(iOpen(NULL,PERIOD_H1,1)<iClose(NULL,PERIOD_H1,1)&&
iOpen(NULL,PERIOD_M30,1)<iClose(NULL,PERIOD_M30,1)&&
iOpen(NULL,PERIOD_M15,1)<iClose(NULL,PERIOD_M15,1)&&
iOpen(NULL,PERIOD_M5,1)<iClose(NULL,PERIOD_M5,1)
{...???
}
I doubt from your code that the conversation is about a fractal. some opening and closing prices on 4 periods.
On a fractal! I tried it with a stop loss - it's losing, I would like to try it with stops on fractals, but I don't know how to write it in the condition. Or how to write it in an EA, I have written an entry condition, something like this
if(iOpen(NULL,PERIOD_H1,1)<iClose(NULL,PERIOD_H1,1)&&
iOpen(NULL,PERIOD_M30,1)<iClose(NULL,PERIOD_M30,1)&&
iOpen(NULL,PERIOD_M15,1)<iClose(NULL,PERIOD_M15,1)&&
iOpen(NULL,PERIOD_M5,1)<iClose(NULL,PERIOD_M5,1)
{...???
}
To test the strategy, it is easier for you to find a trailing stop function by fractals and include it into your EA. Or you can write it yourself.
The function will move the stop of each open position to the necessary fractal set in the settings. And then, based on the test results, we can already think about the advisability of using either this trawl, or closing of market positions when the price reaches the fractal level. Neither of them is an easy thing to do.
The standard function iFractals() will help you. It returns the price at which the fractal is found, as specified in the function parameters.
help please, my indicator measures the maximum minute movement for the current hour on an hour timeframe, the first 6 hours (bars) it measures everything adequately, and then starts some illegal values come up below the code itself and the indicator, tell me where I went wrong, although I do not care values beyond 3 bars, but I fear that errors may occur on the first bar
i think i may have some errors on the first bar.help please, my indicator measures the maximum minute movement for the current hour on an hour timeframe, the first 6 hours (bars) it measures everything adequately, and then starts some illegal values come up below the code itself and the indicator, advise where I went wrong, although I do not care values beyond 3 bars, but I fear that errors may occur on the first bar
i originally had a different indicator, i took it apart and "soldered" my codeWhat did you want to get?
Vinin:
What did you want to get?
I want the indicator to show the maximum value of iOpen-iClose among the minute bars, but for HOUR, for example for an hour of 59 minute bars iOpen-iClose = 3 (for example) and one minute bar iOpen-iClose = 10 and on an hour timeframe, it must show 10 without any deviations and I need the indicator to close orders, if a minute rate goes too fast in the wrong direction, then the adviser will be a signal to close
This is the first version of it and later I want it to be able to detect which way the price is going.
If you click on a graphical object, e.g. a Horizontal Line, you can see a "Description" in the window that opens.
- Is it possible to add a "Description" from the code?
Thank you!
If you click on a graphical object, e.g. a Horizontal Line, you can see a "Description" in the window that opens.
- Is it possible to add a "Description" from the code?
Thank you!
h ttps://docs.mql4.com/ru/objects/ObjectSetText
Just what I needed! Thank you!
LazarevDenis
The initial count is 59 bars, which is incorrect. There may be gaps in minutes, and the last hour bar may contain fewer minutes.
You should take the hour bar open and close time (Time[i]). Use this time to calculate offsets for iBarShift minutes, and then calculate the maximum within this range of offsets.
By the way, what should the indicator show on a minute period?
If the number is positive the price goes upwards, if the number is negative - downwards, returning the number modulo it will show the strength of the movement.