Algorithm: issue the 'ChartOpen' command -> check the value, if the value is greater than '0' -> try the template using the 'ChartApplyTemplate' command.
Code: ChartOpen ChartApplyTemplate.mq5
Thanks for helping me, it works fine. But sometimes the strategy of my logic is executed after another 3 candles or so and the ChartOpen ChartApplyTemplete is executed again and the same chart is opened again, how can i code it so that if chart already is open dont open again, Thank you
Gets history data of MqlRates structure of a specified symbol-period in specified quantity into the rates_array array. The elements ordering of the copied data is from present to the past, i.e., starting position of 0 means the current bar. If you know the amount of data you need to copy, it should better be done to a statically allocated...
Ahmad861 : Thanks for helping me, it works fine. But sometimes the strategy of my logic is executed after another 3 candles or so and the ChartOpen ChartApplyTemplete is executed again and the same chart is opened again, how can i code it so that if chart already is open dont open again, Thank you
Keep records of open charts (more precisely, keep records of not chart numbers, but records of actions: the symbol "such and such", the timeframe "such and such" is already open.
This works fine when i test on a script and run, but i use it in my logic of my expert advisor and even if the condition is false, the code is executed without any problems
Bollinger Bands ® technical indicator (BB) is similar to Envelopes. The only difference is that the bands of Envelopes are plotted a fixed distance (%) away from the moving average, while the Bollinger Bands are plotted a certain number of standard deviations away from it. Standard deviation is a measure of volatility, therefore Bollinger Bands...
GeorgeReji : im using bollinger bands and before trading i check if the distance between upper and lower bollinger band is minimum 30 pips
This works fine when i test on a script and run, but i use it in my logic of my expert advisor and even if the condition is false, the code is executed without any problems
Counting of elements of copied data (indicator buffer with the index buffer_num) from the starting position is performed from the present to the past, i.e., starting position of 0 means the current bar (indicator value for the current bar). When copying the yet unknown amount of data, it is recommended to use a dynamic array as a buffer[]...
Dear Vladimir, can you help me to make an EA with only fractal indicator signals. and wear SL and TP and trailing. for scalping trading. hopefully it can provide better colors in the mql5 world. You are a very good programmer.
10:21
Dear Vladimir, you can help me to make an Expert Advisor based on signals from fractal indicators only. and use SL, TP and trailing. for scalping. Hopefully it will increase the color in the MQL5 world. You are a very good programmer.
10:22
hope you can help me just to share. with fractal indicator codebase only for each transaction. if there is a fractal sign will open if not advance. and placing pending orders above the fractal line from the breakout area.
10:26
In fact, every time there is a transaction, the fracture willfunction. For example the fractal above, the trade will sell dan SL and TP.
Algorithm: issue the 'ChartOpen' command -> check the value, if the value is greater than '0' -> try the template using the 'ChartApplyTemplate' command.
Code: ChartOpen ChartApplyTemplate.mq5
Expert Advisor
Code: Example Bullish Bearish.mq5
To get OHLC from the advisor, it is optimal to request CopyRates to the array of the MqlRates structure. Apply to the array
- now in the 'rates' array element [0] corresponds to the rightmost bar on the chart.
Result:
Thanks for helping me, it works fine. But sometimes the strategy of my logic is executed after another 3 candles or so and the ChartOpen ChartApplyTemplete is executed again and the same chart is opened again, how can i code it so that if chart already is open dont open again, Thank you
Keep records of open charts (more precisely, keep records of not chart numbers, but records of actions: the symbol "such and such", the timeframe "such and such" is already open.
Code: Example Bullish Bearish.mq5
To get OHLC from the advisor, it is optimal to request CopyRates to the array of the MqlRates structure. Apply to the array
- now in the 'rates' array element [0] corresponds to the rightmost bar on the chart.
Result:
Not regular bullish or bearish candles, small bodied candles with large wicks on both sides
You have to take my sample and make changes from it yourself. I can't see your code. I do not see your desire to code.
This works fine when i test on a script and run, but i use it in my logic of my expert advisor and even if the condition is false, the code is executed without any problems
im using bollinger bands and before trading i check if the distance between upper and lower bollinger band is minimum 30 pips
This works fine when i test on a script and run, but i use it in my logic of my expert advisor and even if the condition is false, the code is executed without any problems
What is your question?
Example: how to get the value of the iSAR indicator in an advisor.
Code: iSAR Get Value.mq5
ATTENTION: In OnInit we get the indicator handle (type 'int') - we do it ONCE. Further, we get the indicator values using CopyBuffer .
Advisor code:
Result:
Problem: there can be only one position at a time. The check is the same for netting and hedge accounts.
We check if there is a position by symbol, while there is no check by Magic number.
Code: IsPositionExists.mq5