NexusFi: Find Your Edge


Home Menu

 





renko chart


Discussion in Platforms and Indicators

Updated
    1. trending_up 1,902 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

renko chart

  #1 (permalink)
ankityadav
indore+india
 
Posts: 30 since Jun 2013
Thanks Given: 2
Thanks Received: 2

can some body explain me the logic behind renko chart code that i have

while(!UpTrend && (Low[i] < PrevLow-BoxPoints || CompareDoubles(Low[i], PrevLow-BoxPoints))) {
//depending upon the following condition the while loop executed.
//1)a)(!uptrend)After finding the value of uptrend this loop is executed when uptrend returns false it means that when the trend is moving downward
// b)(low[i]<prevlow-boxpoints)As we know renko chart works in placing the bricks when current price surpasses the top and bottom at some predefined value.
// at this position it simply checks the current low price with the previous low by differencing previous low by some predefined value i..e(Boxpoints).
//it means that current low value is lowest than previous value.
//it means that the trend is in very lowest stage.


// 2)secondly it also compares the current low and difference of previous low and boxpoints. more specifically we can say that it checks whether their values are equal or not.
//It means that this loop is executed at that postion also when the current low price is equal to the difference of previous low and boxpoint PrevHigh = PrevHigh - BoxPoints;//calculate previous high

//if this two conditions is executed than the following things have to be updated .
PrevLow = PrevLow - BoxPoints; //Updates previousLow
PrevOpen = PrevHigh; //update previous open price by previous high value.
PrevClose = PrevLow; //update previous close price by previous low value.
//It means that previous bar open with the high value but closes with a low value means it is in losing stage.
FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);
FileWriteDouble(HstHandle, PrevOpen, DOUBLE_VALUE);
FileWriteDouble(HstHandle, PrevLow, DOUBLE_VALUE);

if(ShowWicks && UpWick > PrevHigh) FileWriteDouble(HstHandle, UpWick, DOUBLE_VALUE);
else FileWriteDouble(HstHandle, PrevHigh, DOUBLE_VALUE);

FileWriteDouble(HstHandle, PrevClose, DOUBLE_VALUE);
FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);

UpWick = 0; //now let we can say that upwick is zero.
DnWick = EMPTY_VALUE; //let dnwick contains empty value.
CurVolume = 0; //let current volume is initialize by zero
CurHigh = PrevLow; // now let us initialize current high by previous low
CurLow = PrevLow; // initialize current low by previous low.
//It means that we are assuming that the current bar is in lowest stage.

if(PrevTime < Time[i]) PrevTime = Time[i]; //if previous bar's time is less than the current bar postion time then previous time is equal to current bar position time.
//In other words, prevTime always refers to the most recent bar's time in calculation
else PrevTime++; //increasing the value of time.
}

while(High[i] > PrevHigh+BoxPoints || CompareDoubles(High[i], PrevHigh+BoxPoints)) {
//depending upon the following condition the while loop executed.
//1)a)high[i] this function find the high value of the current bar i..e it refers to the higher value of current bar.
// b)As we know renko chart works in placing the bricks when current price surpasses the top and bottom at some predefined value.
// (High[i] > PrevHigh+BoxPoints) here it simply check the current high value and previous high value by adding boxpoint in to previous high value.
//It means that current price is greater than previous high and the trend is top stage.
//2)and this loop also compares the current high value and previous high value are equal or not.

PrevHigh = PrevHigh + BoxPoints; //update the previous high
PrevLow = PrevLow + BoxPoints; //update the previous low
PrevOpen = PrevLow; //update previous open price by previous low price.
PrevClose = PrevHigh; //update previous close price by previous high price.
//It means that previous bar is open with a low value but closes with a high value means it is in gaining stage
FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);
FileWriteDouble(HstHandle, PrevOpen, DOUBLE_VALUE);

if(ShowWicks && DnWick < PrevLow) FileWriteDouble(HstHandle, DnWick, DOUBLE_VALUE);
else FileWriteDouble(HstHandle, PrevLow, DOUBLE_VALUE);

FileWriteDouble(HstHandle, PrevHigh, DOUBLE_VALUE);
FileWriteDouble(HstHandle, PrevClose, DOUBLE_VALUE);
FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);

UpWick = 0; // initialize upwick by zero.
DnWick = EMPTY_VALUE; //initialize dnwick with a empty value.
CurVolume = 0; //current volume is initialize by zero.
CurHigh = PrevHigh; //Initialize current high value by previous high
CurLow = PrevHigh; //Initialize curlow by previous high.
//Here we assuming that the current bar having high low and higher high.

if(PrevTime < Time[i]) PrevTime = Time[i]; //if previous time is less than the current bar postion time then previous time is equal to current bar position time.
//In other words, prevTime always refers to the most recent bar's time in calculation
else PrevTime++; //increasing the value of time.

}

while(UpTrend && (Low[i] < PrevLow-BoxPoints || CompareDoubles(Low[i], PrevLow-BoxPoints))) {
//depending upon the following condition the while loop executed.
// 1)a)This condition is same as the first while loop except uptrend here uptrend return true it means that the trend is going upward.
// (UpTrend && (Low[i] < PrevLow-BoxPoints) this condition apper when the trend is moving upward but instantly we got downward trend.
//for this purpose this loop is putting here.
//it also checks the current low price to previous low price with predefined variable(Boxpoints) whether it is lowest or not.
2)And also compares the current low price and previous low price with predefined variable(Boxpoints) whether it is equal or not.
PrevHigh = PrevHigh - BoxPoints; //calculate the previous high
PrevLow = PrevLow - BoxPoints; //calculate the previous low
PrevOpen = PrevHigh; //initialize previous open price by previous high value.
PrevClose = PrevLow; //initialize previous close price by previous low price.
//here it means that the bar open with high value but close with low value. the bar is moving downward.
FileWriteInteger(HstHandle, PrevTime, LONG_VALUE);
FileWriteDouble(HstHandle, PrevOpen, DOUBLE_VALUE);
FileWriteDouble(HstHandle, PrevLow, DOUBLE_VALUE);

if(ShowWicks && UpWick > PrevHigh) FileWriteDouble(HstHandle, UpWick, DOUBLE_VALUE);
else FileWriteDouble(HstHandle, PrevHigh, DOUBLE_VALUE);

FileWriteDouble(HstHandle, PrevClose, DOUBLE_VALUE);
FileWriteDouble(HstHandle, CurVolume, DOUBLE_VALUE);

UpWick = 0; //now again initialize to upwick variable
DnWick = EMPTY_VALUE; //initialize dnwick variable with a empty value
CurVolume = 0; //current volume is initialize
CurHigh = PrevLow; //made curhigh variable by previous low which is used to find the current high.
CurLow = PrevLow; //made curlow variable by previous low which is used to find the current low.

if(PrevTime < Time[i]) PrevTime = Time[i]; //if previous time is less than the current bar postion time then previous time is equal to current bar position time.
//In other words, prevTime always refers to the most recent bar's time in calculation

else PrevTime++; //increasing the value of time.
}
i--; //i variable is decremented
}

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
My NQ Trading Journal
12 thanks
  #2 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

The logic is pretty clearly explained in the comments, look at every line marked with a // for the comments.

Reply With Quote
  #3 (permalink)
ankityadav
indore+india
 
Posts: 30 since Jun 2013
Thanks Given: 2
Thanks Received: 2


Thanks for your reply sir but I don't understand the logic because it's hard to visual tick-by-tick what is happening.Can you explain me what the three loops doing.

Reply With Quote




Last Updated on September 19, 2013


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts