Range Bar Chart on MT4 - page 51

 
Jack1:
Thank you very much.

My indicators are new bar trigger. I will check my indicators again.

But, metaquote's standard indicators are tick trigger, like, moving average line, BB, macd. These may cost calculation time.

Jack1

If your indicator(s) is using IndicatorCounted() in any place then you have to change it. That function is returning wrong values in offline charts with all the new builds

 

thank,

Ok, I use IndicatorCounted() in my macd indicator. If this function is not used. Then, only way may be new mt4 or mt5 format:

int OnCalculate(const int rates_total,

const int prev_calculated,

I have watched these two variables on offline chart; "rates_total" is quite reliable; but, "prev_calculated" sometime be "0"; don't know why;

In new mt4, OnStart(), OnCalculate() are still tick event trigger. If I look for a new bar event trigger? which is good way to do in new mt4?

int limit=rates_total-prev_calculated;

if(limit<=0) return(rates_total); //not new bar

If(time[0] == PastOpentime) return(0);

PastOpentime = time[0];

other way ?

 
Jack1:
thank,

Ok, I use IndicatorCounted() in my macd indicator. If this function is not used. Then, only way may be new mt4 or mt5 format:

int OnCalculate(const int rates_total,

const int prev_calculated,

I have watched these two variables on offline chart; "rates_total" is quite reliable; but, "prev_calculated" sometime be "0"; don't know why;

In new mt4, OnStart(), OnCalculate() are still tick event trigger. If I look for a new bar event trigger? which is good way to do in new mt4?

int limit=rates_total-prev_calculated;

if(limit<=0) return(rates_total); //not new bar

If(time[0] == PastOpentime) return(0);

PastOpentime = time[0];

other way ?

Check what value are you receiving in the OnCalculate() function for prev_calculated. It is returning correct value, so that solution can be used

 

They still did not correct basic functions?

Seems like a major confusion there

What about trading functions?

 

I found open trade is ok. But, I modified stoploss 10 pips away to Ask price for short positions, then, all my positions were closed out. when I modified stoploss 20 pips away, it works. Don't know why?

I got IG demo mt4, it wouldn't open trade at all. Fxcm mt4 is ok for open, close trade. Brokers may set up their rules for trading functions on mt4, couldn't they do?

 
Jack1:
I found open trade is ok. But, I modified stoploss 10 pips away to Ask price for short positions, then, all my positions were closed out. when I modified stoploss 20 pips away, it works. Don't know why? I got IG demo mt4, it wouldn't open trade at all. Fxcm mt4 is ok for open, close trade. Brokers may set up their rules for trading functions on mt4, couldn't they do?

Are those pips or points?

It looks like they are set to points and that it is the reason why so fast close. Check if it is the case

 

Shouldn't it be the same on what broker it is executed (after all those are range bars)?

 

I found the problem is Digits. Forex pairs are Digits is 3 for xxx-jpy, Digits is 5 for eur-usd, etc.

But, US30, SPX500 got Digits =0 and Digits =1. So, pips calculation got a problem. Fixed ok.

 

I found this indicator. It can generate two offline charts of renko bar, but, look like range bar ? or other name?

1st, 2nd or 3rd bar enter a trade. Try.

 

That is because it creates bars divided into 1 pips change (instead of drawing just 1 bar). That is why it looks so smooth - but the change in price was nothing even remotely close to that

Reason: