Renko ACSIL? - futures io
futures io futures trading



Renko ACSIL?


Discussion in Sierra Chart

Updated by Amnesia
      Top Posters
    1. looks_one Amnesia with 9 posts (0 thanks)
    2. looks_two aslan with 4 posts (2 thanks)
    3. looks_3 vegasfoster with 2 posts (1 thanks)
    4. looks_4 cory with 1 posts (0 thanks)
    1. trending_up 3,102 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 16 replies
    2. attach_file 7 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Renko ACSIL?

(login for full post details)
  #11 (permalink)
Vienna Austria
 
 
Posts: 116 since Mar 2012
Thanks: 16 given, 67 received


aslan View Post
1. The index check is not technically needed, because SC will guard against accessing bad array indexes. However, it is good practice to not access values that do not exist, especially if they affect your overall logic moving forward (i.e. you do not want to generate bogus data that then feeds forward).

2. Vegas can explain his intent, but he is basically back propagating the values for the next calculation.

3. The assignment of sc.DataStartIndex really belongs in the SetDefaults block. (minor)

4. While I said that drawings would not slow you down, this code is a good example where I would not use them just because the code is so simple, and drawings would add some complexity. Only add them if you need to.

Okay just a small touchup on 2)

Once the for loop is done it basically repeats the entire process starting again at the top doing calculations but this time for the next bar correct?
Because since this is on autoloop it will cycle through every single candle until it has hit the array end. So it will perform the bool calcualtion for index 5 then it will do it for index 6 then 7 then 8 etc etc correct?

So why would i want to propagate values backwards when the calculation is going to be done anyways?

Reply With Quote

 
 
(login for full post details)
  #12 (permalink)
Madison, WI
 
Experience: Advanced
Platform: Sierra Charts, ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,107 received


Amnesia View Post
Okay just a small touchup on 2)

Once the for loop is done it basically repeats the entire process starting again at the top doing calculations but this time for the next bar correct?
Because since this is on autoloop it will cycle through every single candle until it has hit the array end. So it will perform the bool calcualtion for index 5 then it will do it for index 6 then 7 then 8 etc etc correct?

So why would i want to propagate values backwards when the calculation is going to be done anyways?

No, you only get called for each historical bar once when you start up (i.e. you will be called once for each bar 0, 1, 2, ..., last bar). You then get called for each update to the current bar (i.e. 138, 138, 138, 138, ... 139, ....). Again, I do not know the intent or that loop, but it is getting copied back one for the calc on next bar, perhaps the second copy is for visual effect?

Reply With Quote
The following user says Thank You to aslan for this post:
 
(login for full post details)
  #13 (permalink)
Vienna Austria
 
 
Posts: 116 since Mar 2012
Thanks: 16 given, 67 received



aslan View Post
No, you only get called for each historical bar once when you start up (i.e. you will be called once for each bar 0, 1, 2, ..., last bar). You then get called for each update to the current bar (i.e. 138, 138, 138, 138, ... 139, ....). Again, I do not know the intent or that loop, but it is getting copied back one for the calc on next bar, perhaps the second copy is for visual effect?

@aslan

 
Code
sc.DataStartIndex = 5;
	if (sc.Index > 5)
	
	{
		
	bool Long = sc.Close[sc.Index-3] < sc.Close[sc.Index-4] && 
				sc.Close[sc.Index-2] > sc.Close[sc.Index-3] && 
				sc.Close[sc.Index-1] > sc.Close[sc.Index-2] && 
				sc.Close[sc.Index] > sc.Close[sc.Index-1];
	
	
	Plot1[sc.Index] = Long ? sc.Low[sc.Index-2] : Plot1[sc.Index-1]; //Condition parameters
		
	int Index = sc.Index;
	
	for(int i = 1; i<=2; i++)
	{
		Plot2[Index-i] = Plot1[sc.Index];		
	}
	
	}
}
So this part of the code gets called on startup and is run through each bar (first bar to the right up to the last bar on the left) or to put it in code terms from sc.currentindex all the way to the left of the chart to sc.ArraySize-1

And once that is done it is called once for each currentbar update, or in other terms everytime the sc.index/sc.currentindex changes or gets a new value?

Reply With Quote
 
(login for full post details)
  #14 (permalink)
Madison, WI
 
Experience: Advanced
Platform: Sierra Charts, ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,107 received


Amnesia View Post

So this part of the code gets called on startup and is run through each bar (first bar to the right up to the last bar on the left) or to put it in code terms from sc.currentindex all the way to the left of the chart to sc.ArraySize-1

And once that is done it is called once for each currentbar update, or in other terms everytime the sc.index/sc.currentindex changes or gets a new value?

Yes, at startup it would be called once with sc.Index set to 0 .. sc.ArraySize-1 (in that order). Then it would only be called with sc.Index set to the current bar index (updates to current bar or a new bar gets started) This is how autoloop works.

Reply With Quote
The following user says Thank You to aslan for this post:
 
(login for full post details)
  #15 (permalink)
Vienna Austria
 
 
Posts: 116 since Mar 2012
Thanks: 16 given, 67 received


aslan View Post
Yes, at startup it would be called once with sc.Index set to 0 .. sc.ArraySize-1 (in that order). Then it would only be called with sc.Index set to the current bar index (updates to current bar or a new bar gets started) This is how autoloop works.

This..... This clarified a shitton i cannot thank you enough and kind of clarifies a lot of things

As for the loop, i guess i should just cut it out then since it serves no use for this right now. But i will ask vegas about it.

Reply With Quote
 
(login for full post details)
  #16 (permalink)
Vienna Austria
 
 
Posts: 116 since Mar 2012
Thanks: 16 given, 67 received

Sooo...

I have made some modifications to the code, after i finally was able to understand why @vegasfoster was using that for loop (thanks again btw for answering all those pesky pm's)

I decided to play around with the code a bit. So here is basically why vegas was using the for loop:

https://futures.io/attachments/116695d1372201946
https://futures.io/attachments/116696d1372201946

Basically it is necessary to make sure the horizontal line is exactly where i want it to be.

Now i have modified the code to the following and basically made it much simpler:

 
Code
	sc.DataStartIndex = 5;
	if (sc.Index > 5)
	
	{
		
	bool Long = sc.Close[sc.Index-3] < sc.Close[sc.Index-4] && 
				sc.Close[sc.Index-2] > sc.Close[sc.Index-3] && 
				sc.Close[sc.Index-1] > sc.Close[sc.Index-2] && 
				sc.Close[sc.Index] > sc.Close[sc.Index-1];
	
	if (Long == true)
		{ 
		Plot1[sc.Index-2] = sc.Low[sc.Index-2];
		}
		
	
	
	}
}
Basically all it does is for every iteration that is happening during autoloop being on, it checks if the bool value is true, and if it is it draws it at index-2 with the value of sc.low that is located at index-2.

All fine and dandy and working except for this:


The horizontal line is quite short...

So my questions are

1) Any criticism on the code? Weaknesses from a logic perspective?
2) Any idea how to make that horizontal line longer?

EDIT: Yeah nvm i think i see it now, thats pretty much what the ternary operator did... god damnit, im trying to put this into the "Else" part of the If statement, will update my code into here as i work along and figure stuff out, perhaps it may help someone when they are working on developing their custom study

EDIT2:

Yeah got it working

 
Code
	sc.DataStartIndex = 5;
	if (sc.Index > 5)
	{
		
	bool Long = sc.Close[sc.Index-3] < sc.Close[sc.Index-4] && 
				sc.Close[sc.Index-2] > sc.Close[sc.Index-3] && 
				sc.Close[sc.Index-1] > sc.Close[sc.Index-2] && 
				sc.Close[sc.Index] > sc.Close[sc.Index-1];
	
	if (Long == true)
	{ 
		Plot1[sc.Index-2] = sc.Low[sc.Index-2];
	}
	
	else
	{
		Plot1[sc.Index-2] = Plot1[sc.Index-3];
		
	}
	}
}

Attached Thumbnails
Click image for larger version

Name:	plot1.PNG
Views:	54
Size:	35.7 KB
ID:	116695   Click image for larger version

Name:	plot2.PNG
Views:	49
Size:	40.4 KB
ID:	116696  
Reply With Quote
 
(login for full post details)
  #17 (permalink)
Vienna Austria
 
 
Posts: 116 since Mar 2012
Thanks: 16 given, 67 received

Minor modifications:

 
Code
sc.DataStartIndex = 5;
	if (sc.Index > 5)
	
	{
		
	bool Long = sc.Close[sc.Index-3] < sc.Close[sc.Index-4] && 
				sc.Close[sc.Index-2] > sc.Close[sc.Index-3] && 
				sc.Close[sc.Index-1] > sc.Close[sc.Index-2] && 
				sc.Close[sc.Index] > sc.Close[sc.Index-1];
	
	if (Long == true)
	{ 
		Plot1[sc.Index-2] = sc.BaseData[SC_RENKO_CLOSE][sc.Index-3]; 
		Plot2[sc.Index-2] = sc.BaseData[SC_RENKO_OPEN][sc.Index-2]; 
	}
	
	else
	{
		Plot1[sc.Index-2] = Plot1[sc.Index-3];
		Plot2[sc.Index-2] = Plot2[sc.Index-3];
		
	}
		
	
	
	}

Reply With Quote


futures io Trading Community Platforms and Indicators Sierra Chart > Renko ACSIL?


June 25, 2013


Upcoming Webinars and Events
 

Introducing Edge Pools: Prop Pricing Model w/Edge Clear

Jul 9
 

Every journal equals ten meals for the hungry

Now
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts