Renko ACSIL? - Sierra Chart Programming | futures io social day trading
futures io futures trading


Renko ACSIL?
Updated: Views / Replies:2,240 / 16
Created: by Amnesia Attachments:7

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 7  
 
Thread Tools Search this Thread
 

Renko ACSIL?

  #11 (permalink)
Trading for Fun
Vienna Austria
 
Futures Experience: Advanced
Platform: Sierra Chart
Favorite Futures: NQ, FGBL, 6E, GC
 
Posts: 116 since Mar 2012
Thanks: 16 given, 65 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
 
  #12 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 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:
 
  #13 (permalink)
Trading for Fun
Vienna Austria
 
Futures Experience: Advanced
Platform: Sierra Chart
Favorite Futures: NQ, FGBL, 6E, GC
 
Posts: 116 since Mar 2012
Thanks: 16 given, 65 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
 
  #14 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 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:
 
  #15 (permalink)
Trading for Fun
Vienna Austria
 
Futures Experience: Advanced
Platform: Sierra Chart
Favorite Futures: NQ, FGBL, 6E, GC
 
Posts: 116 since Mar 2012
Thanks: 16 given, 65 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
 
  #16 (permalink)
Trading for Fun
Vienna Austria
 
Futures Experience: Advanced
Platform: Sierra Chart
Favorite Futures: NQ, FGBL, 6E, GC
 
Posts: 116 since Mar 2012
Thanks: 16 given, 65 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:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


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
Renko ACSIL?-plot1.png   Renko ACSIL?-plot2.png  

Last edited by Amnesia; June 25th, 2013 at 08:12 PM.
Reply With Quote
 
  #17 (permalink)
Trading for Fun
Vienna Austria
 
Futures Experience: Advanced
Platform: Sierra Chart
Favorite Futures: NQ, FGBL, 6E, GC
 
Posts: 116 since Mar 2012
Thanks: 16 given, 65 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

Reply



futures io > > > > > Renko ACSIL?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Instructional videos about ACSIL with Visual studio and other ACSIL programming t yonatan Sierra Chart Programming 2 January 29th, 2013 03:34 PM
ACSIL: Execute only On Removal of a Study yonatan Sierra Chart Programming 3 November 5th, 2012 12:52 PM
Need help - TSI - Function in ACSIL ejtrader Sierra Chart Programming 1 September 11th, 2012 10:07 PM
Need help - ACSIL - related questions ejtrader Sierra Chart Programming 2 August 30th, 2012 11:35 AM
Webinar - ACSIL with Visual Studio yonatan Sierra Chart Programming 1 August 16th, 2012 06:05 AM


All times are GMT -4. The time now is 07:30 AM.

Copyright © 2017 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
Page generated 2017-12-11 in 0.14 seconds with 20 queries on phoenix via your IP 54.226.132.197