Renko Charts and once per bar function
-
I am wondering if the once per bar function really works on renko offline charts
when running an EA live I want to delete a group of pendings orders at the start of a new bar if somm conditions are met.
The pendings grid is then regenerated with new values, and should not be deleted again until an new bar is formedwhen I manually program I used the following function, which worked
//input parameter
int thisbar =0;//then to test whether is is valid
if (Bars != thisbar)
{
thisbar = Bars;//do something here
}is it true that on renko the once per bar does not work?
if yes can we change the once per bar function or add a custom one?
if no can you help me to solve my problem? -
The last time I tried Once per bar with Renko charts, it worked for me. Probably because my renko-creator-ea puts different Time for each renko candle that it creates. But Renko is not a standart in MetaTrader, I have no idea what EAs you are using to generate these offline charts... at least someone can give me his EA so I can test it. But mine seems to work
-
I use the following, it is an indicator
-
What a strange looking candles
But it's Saturday now, I will be able to test it in MondayAnyway, I decided to see what Times are returned and everything looks fine http://prntscr.com/7wotrs The top 4 values in the comment are Time, below are Candle Close prices. From what I see, "Once per bar" must work as expected.
-
Yes very strange
i Like them
Just so you know the BrickStepTime function does not wrok properly, just set to false
If you want I can send you my template, let me knowconsidering the times, if they are the time of the previous bar they are correct, I think the indicator writes the times and open and close prices at the closure of the bar,
but within the current bar my fucntions, I send a sendnotification after a once per bar, and it gets executed every tick or at least very often -
I got this: http://prntscr.com/7xhwbn
Arrows are put on the previous candle and the value of Time[0] changes. I think it's not correctly written or something like that. With normal candles each candle has it's own unique Time and it does not change. It's the same with my Renko EA. This one... I don't know what can be used to detect new candles. For a while I was thinking that Candle Open can be used, but it just created a new candle that is exactly on the same level as the previous: http://prntscr.com/7xhz3i -
I know it is a bit weird
but I would really appreciate if we can figure it out
this renko has two exceptional functions: you set the size of the flip, this takes out a lot of whipsaw, and you can determine the size of trend confirmation, so if price moves with the trend you can set a renko bar to 100points(10pips), have a new bar create when price moves with trend of example 20point (2pips), but only a countertrend is created when the bar flips 100%, so a reverse of 200point, 20pips.
This allows me to trade price directly on the chart without an additionla indicator, this indicator takes care of smoothing and whipsawAnyway, before starting to use your incredible tool, I did some MQ4 coding, a lot of copy past of course,
I used the following to assure my EA only executed a certain block once per bar, which worked
can I just create a custom block for this, if yes some help would be appreciated// on global
int thisbar = 0;//then within a certain block
void do_trend()
{
if (Bars != thisbar)
{
thisbar = Bars;// declare some function
}
Bars just simply counts the number of bars in history and compares to my value
if different we execute, is same we dont executeHope this helps
-
What if we have this situation: http://prntscr.com/7xkebh
-
I don't like Bars, because it depends on our settings. But I realised that we can use bar 1 instead of bar 0 with the same success. The Time of bar 1 also changes when a new bar is created, so it can be used for online charts. In your chart Time (1) is at least constant while the candle exists. I just changed one value from 0 to 1 in "Once per bar" and it works now, you can try it.
There are other blocks that have the same "once per bar" functionality in them and I "fixed" some of them... hopefully all of them, but if you find that some block shoud do something 1 time per bar and it does not, tell me.
-
That sounds great!
So I recompile my EA and test for once per barI will confirm at the end of day
Thanks
-
end of day, became this morning
but as far as I can tell, the once per bar function works perfectly now!THANKS
-
Hello...
I'm having issues making an EA work with renko offline charts. How did you make it possible?Thanks
__end of day, became this morning
but as far as I can tell, the once per bar function works perfectly now!THANKS[/quote:2915fvtz]
-
Give me your renko... EA, indicator or whatever it is... I know that there are many robots and versions out there, I can't say what is wrong if I don't know which one of them is used. And also tell me what is the problem exactly