Coding help - page 750

 
bilbao:

mr mladen :

could you add alarm on it when candle close

it have just alarm on current candle

 

regard 

Try it out
Files:
 
mladen:
Try it out

thanks very much

must put it on 1?  

 

Is there any simple way of accessing MT5 indicator data for an on chart display. I know that initially when MT5 first came out the code was quite complicated for just a simple indicator and I am hopeful with the latest version of MT5 something may have changed?

 For example if I want to show a MA cross on chart object display with MT4 I use

 double slow_MA =  iMA(Symbol(),0,100,0,MA_MODE,MA_PRICE,0);  

 double fast_MA =  iMA(Symbol(),0,35,0,MA_MODE,MA_PRICE,0); 

if (ma_fast > ma_slow){ col = clrLime;}

if (ma_fast < ma_slow) {col = clrRed;}

else {col = clrGray;}


is there any simple equivalent in MT5? or do I have to write untold lines of code to access this information?

I found the simple answer - it was to convert the mq4 instead of rewriting the code totally using mq5. 

 
bilbao:

thanks very much

must put it on 1?  

Yes
 
mladen:
Yes

Dear @mladen,

Can you add attached indicator "Horizontal and Vertical Alignment" settings, I would be very pleased.

Thank you. 

 
oguz:

Dear @mladen,

Can you add attached indicator "Horizontal and Vertical Alignment" settings, I would be very pleased.

Thank you. 

Please post original (non-decompiled) source code so that it can be checked
 
mladen:
Please post original (non-decompiled) source code so that it can be checked

Sorry!

I found this.

I hope this is original indi.

 

There is a charting method which is somewhat similar to Renko boxes but it is told better from certain points of view. 

Point Original charting (http://www.az-invest.eu/point-original-bars-for-metatrader)

Point Original Bars (https://ovo.cz/products/offline-charts-for-mt4/point-original-bars)

I did not find sufficient information about the calculation of such bars, the only one I found is on one of the sites I mentioned above:

"... Point-O bars hold the range from open to close at a constant level. They only require the price to retrace to the original open value of the previous bar in order to form a new bar. This form of charting makes it very easy to spot support & resistance levels and simplifies catching of reversal points.

This charting type also enables the trader to maintain the correct OHLC values for a given day (ones that correspond to the day's Open, High, Low & Close values) by providing a special setting which enables this feature (notice the circled points on the chart, where the open price have been reset when the new day started on the charting platform)."


I took RenkoMeanLivechart_v1.0_new_format_Alerts.mq4 and modified: Rows 218-220; 256-258; 293-295; 379-381; 423-425; without success. It compiles without any error or warning but does not work but freezes the MT4 platform. I attach the "result" of my experiment.


A coding help would be appreciated.


Files:
 
chrisstoff:

There is a charting method which is somewhat similar to Renko boxes but it is told better from certain points of view. 

Point Original charting (http://www.az-invest.eu/point-original-bars-for-metatrader)

Point Original Bars (https://ovo.cz/products/offline-charts-for-mt4/point-original-bars)

I did not find sufficient information about the calculation of such bars, the only one I found is on one of the sites I mentioned above:

"... Point-O bars hold the range from open to close at a constant level. They only require the price to retrace to the original open value of the previous bar in order to form a new bar. This form of charting makes it very easy to spot support & resistance levels and simplifies catching of reversal points.

This charting type also enables the trader to maintain the correct OHLC values for a given day (ones that correspond to the day's Open, High, Low & Close values) by providing a special setting which enables this feature (notice the circled points on the chart, where the open price have been reset when the new day started on the charting platform)."


I took RenkoMeanLivechart_v1.0_new_format_Alerts.mq4 and modified: Rows 218-220; 256-258; 293-295; 379-381; 423-425; without success. It compiles without any error or warning but does not work but freezes the MT4 platform. I attach the "result" of my experiment.


A coding help would be appreciated.


What exact changes did you make?

Did you compare the changes to the original, revert them and try making one change at a time?

 
mladen:

What exact changes did you make?

Did you compare the changes to the original, revert them and try making one change at a time?

Mladen,

Thank you for the advice. Attached are both indicators, the original
RenkoMeanLivechart_v1.0_new_format_Alerts.mq4
and the modified
Experiment_POC.mq4

The modifications 
Original (in RenkoMeanLivechart_v1.0_new_format_Alerts.mq4):

while(!UpTrend && (Low[i] < PrevLow - 0.5 * BoxPoints || CompareDoubles(Low[i], PrevLow - 0.5 * BoxPoints))) {
                  PrevHigh = PrevHigh - 0.5 * BoxPoints;
                  PrevLow = PrevLow - 0.5 * BoxPoints; 

Modified (in Experiment_POC.mq4):

while(!UpTrend && (Low[i] < PrevLow || CompareDoubles(Low[i], PrevLow)))
{
               //PrevHigh = PrevHigh - 0.5 * BoxPoints;
               //PrevLow  = PrevLow  - 0.5 * BoxPoints;

 All the changes are the same since the code snippets are there repeatedly in Rows 218-220; 256-258; 293-295; 379-381; 423-425.

Reason: