WHRoeder:
Since there are no slaves here, you have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.
Since there are no slaves here, you have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.
So in the above code it will firstly write the historical data. If i could define a criteria for previous renko-bar, i can make it my self. Actually i want to know how can i define the previous up or down renko-bar in order to define current renko-bar HLOC.
I define the below code but it did not work:
if the below definitions are wrong please help me.
Close[start_pos+1] > Close[start_pos+2] // so it means that the previous renko-bar was a Up renko-bar Close[start_pos+1] < Close[start_pos+2] // so it means that the previous renko-bar was a Down renko-bar
Close[start_pos+1] > Close[start_pos+2] // so it means that the previous renko-bar was a Up renko-bar
Close[] is the source chart not the renko chart.
BoxAmount > 0 means the current box is an Up | double lastHigh = Close[start_pos],lastLow = Close[start_pos]; : if(boxAmount>0) { lastLow = lastHigh; lastHigh +=boxPointSize; boxAmount--; d_open = lastLow; d_high = lastHigh; d_low = lastLow; d_close = lastHigh; |
You want the open to be the previous renko bar's close. | double lastHigh = Close[start_pos],lastLow = Close[start_pos]; double prevClose= Close[start_pos]; : if(boxAmount>0) { lastLow = lastHigh; lastHigh +=boxPointSize; boxAmount--; d_open = prevClose; // d_open = lastLow; d_open = lastLow; d_high = lastHigh; d_low = lastLow; d_close = lastHigh; prevClose = d_close |
Same change for the down bar.
WHRoeder:
Same change for the down bar.
where did you define lastclose for this Tag: Close[] is the source chart not the renko chart.
BoxAmount > 0 means the current box is an Up | |
You want the open to be the previous renko bar's close. |
Same change for the down bar.
d_open = lastClose; // did you mean prevclose?
As i understand, i must define prevclose on the top of script and for every new bar condition i must rewrite d_open=prevclose; and on the end of paragraph i must write prevclose=d_close so for the next renko bar we have prevclose as current open price bar? is it ture?
hmrt135: where did you define lastclose for this Tag:
Yes prevClose.
WHRoeder:
Yes prevClose.
Yes prevClose.
I did your advise but the result seems like this picture and it does not draw reverse candles:
#property show_inputs #include <WinUser32.mqh> extern int boxSize = 50; int ExtHandle=-1; //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { int i, start_pos, last_fpos, i_time; double d_open, d_low, d_high, d_close, d_volume; //---- History header int version=400; string c_copyright; string c_symbol=Symbol(); int i_period=boxSize+1; int i_digits=Digits; int i_unused[13]; //---- ExtHandle=FileOpenHistory(c_symbol+i_period+".hst", FILE_BIN|FILE_WRITE); if(ExtHandle < 0) return(-1); //---- write history file header c_copyright="(C) 4e, 4ebur@mail.ru"; FileWriteInteger(ExtHandle, version, LONG_VALUE); FileWriteString(ExtHandle, c_copyright, 64); FileWriteString(ExtHandle, c_symbol, 12); FileWriteInteger(ExtHandle, i_period, LONG_VALUE); FileWriteInteger(ExtHandle, i_digits, LONG_VALUE); FileWriteInteger(ExtHandle, 0, LONG_VALUE); //timesign FileWriteInteger(ExtHandle, 0, LONG_VALUE); //last_sync FileWriteArray(ExtHandle, i_unused, 0, 13); //---- write history file start_pos=Bars-1; Comment("open offline ",c_symbol,"M", boxSize + 1); datetime time = iTime(NULL,0,i); double difference,x1,x2; double boxPointSize = boxSize*Point; int boxAmount; double lastHigh = Close[start_pos],lastLow = Close[start_pos], prevclose=Close[start_pos]; for(i=start_pos-1;i>=0; i--) { x2 = Close[i]; if((x2<=lastHigh)&&(x2>=lastLow)) continue; if(x2>lastHigh) {x1 = lastHigh;} if(x2<lastLow) {x1 = lastLow;} difference = x2-x1; boxAmount =difference/boxPointSize; int ctime = 0; while(boxAmount != 0) { if(boxAmount>0 ) { lastLow = lastHigh; lastHigh +=boxPointSize; boxAmount--; d_open = d_close; d_high = lastHigh; d_low = lastLow; d_close = lastHigh; prevclose=d_close; d_volume = 2; i_time =iTime(NULL,0,i)+ctime; ctime+=60; } if(boxAmount<0) { lastHigh = lastLow; lastLow -= boxPointSize; boxAmount++; d_open = d_close; d_high = lastHigh; d_low = lastLow; d_close = lastLow; prevclose=d_close; d_volume = 1; i_time =iTime(NULL,0,i)+ctime; ctime+=60; } last_fpos=FileTell(ExtHandle); //Ïîñëåäíÿÿ ïîçèöèÿ FileWriteInteger(ExtHandle, i_time, LONG_VALUE); FileWriteDouble(ExtHandle, d_open, DOUBLE_VALUE); FileWriteDouble(ExtHandle, d_low, DOUBLE_VALUE); FileWriteDouble(ExtHandle, d_high, DOUBLE_VALUE); FileWriteDouble(ExtHandle, d_close, DOUBLE_VALUE); FileWriteDouble(ExtHandle, d_volume, DOUBLE_VALUE); FileFlush(ExtHandle); } } FileFlush(ExtHandle); //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void deinit() { if(ExtHandle>=0) { FileClose(ExtHandle); ExtHandle=-1; } } //+------------------------------------------------------------------+
hmrt135: I did your advise but the result seems like this picture and it does not draw reverse candles:
What you Just posted | What I posted |
---|---|
d_open = d_close; d_high = lastHigh; d_low = lastLow; d_close = lastHigh; prevclose=d_close; | d_open = prevClose;
// d_open = lastLow;
d_high = lastHigh;
d_low = lastLow;
d_close = lastHigh; prevClose = d_close |
Can you read?
WHRoeder:
Can you read?
What you Just posted | What I posted |
---|---|
Can you read?
Thank you for your response.
I have changed the code, but unfortunately the same problem occurs and the the chart seems like the above chart.
Since there are no slaves here, you have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.
- You didn't make any attempt so I gave you some code.
- You didn't make any attempt, the code you put in was wrong.
- You didn't make any attempt, where have you placed your print statements to find out why your changed code has the same problem.
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
Hi all,
In the below table you have Traditional renko chart script. In Noraml Renko chart you do not see the real Open Price for renko candel. If anybody can change the following renko code or have LogiBar mean renko script please share it here.