NexusFi: Find Your Edge


Home Menu

 





Renko ACSIL?


Discussion in Sierra Chart

Updated
      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 4,899 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 16 posts
    2. attach_file 7 attachments




 
Search this Thread

Renko ACSIL?

  #1 (permalink)
Amnesia
Vienna Austria
 
Posts: 116 since Mar 2012
Thanks Given: 16
Thanks Received: 67

So... I have been looking to automate something i am doing manually for higher timeframe charts. Which to be precise is to mark "zones" on higher timeframes after i see 3 consecutive bricks in one direction after a reversal renko bar.




The general idea can be understood and seen quickly from the attached chart. Whenever there is a reversal bar, if there are 3 bars moving in the same direction (including the reversal bar) i mark the lower end with an extending rectangle.
(Too be fair depending on the constellation, brick size etc sometimes i will only mark the tail/wick and sometimes the entire structure but for discussion purposes i chose to make the illustrated example rather simple).

Now the question remains is how do i implement this in the most efficient way in ACSIL? I have taken a look at the Autotrendline study Sierrachart has coded for some clues/ideas/references but it seems right now the most effective way would be to let a Loop run where every bar is compared with the previous bar and the next 3 following bar.



I.e It would compare bar at index X to the previous bar at X-1 if X's Close > X-1 Close then the first condition is met.
and then obviously (x+1 close > x close) and (x+2 Close > X+1 Close)

So if Conditions:
1) X Close > X-1 Close
2) X+1 Close > X Close
3) X+2 Close > X+1 Close

Are met then we would use the ACSIL reference code to draw an extending rectangle With the lower and upper line parameters of X-1 Close (lower rectangle line) and X Open (upper rectangle line).

Now the question is how would i most effectively implement this? Does anyone have tutorials or examples of ACSIL coded studied that do something similar? Because my biggest problem right now is the Indexing of the seperate bars.

I would appreciate insight/help into this from anybody.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Request for MACD with option to use different MAs for fa …
NinjaTrader
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
51 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
GFIs1 1 DAX trade per day journal
31 thanks
What percentage per day is possible? [Poll]
31 thanks

  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


so this method is long only?

Reply With Quote
  #4 (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

I've never drawn tools in ascil before, so I would just draw two lines and fill them. The lines will be draw from the current index, but you want to go back, so I think you can create a custom index just for previous 3 bars and make two additional lines that are equal to the current lines. Never done it before though, so you will have to try it out, but I'm thinking something like:


 
Code
Line1[sc.Index] = desired formula;
Line2[sc.Index] = desired formula;

Int Index = sc.Index;

for(int i = 1; i<=3; i++)
{
Line3[Index-i] = Line1[sc.Index];
Line4[Index-i] = Line2[sc.Index];
}
The lines will overlap starting on the current index, but I don't think that will cause problems. If you don't want to use lines, then you will have to study up on the tools, cuz I can't help you there, and I'm sure there is a better way to do it if someone else wants to chime in.

Reply With Quote
  #5 (permalink)
Amnesia
Vienna Austria
 
Posts: 116 since Mar 2012
Thanks Given: 16
Thanks Received: 67


cory View Post
so this method is long only?

@cory

Yes obviously you can inverse the conditions to get the opposite for shorts.

I have thought a little bit more about the implementation, i will need to read up on how ACSIL handles indexing and then i guess the only remaining issues are "overpainting" or adding too many rectangles as the loop continues/repeats itself from the base index and obviously how to make this more resource friendly and implement it.

I will write some Pseudocode for this entire thing and i guess try to implement it then ultimately =/

Anyone got pointers/suggestion on already existing code to look at or what to read?

Reply With Quote
  #6 (permalink)
Amnesia
Vienna Austria
 
Posts: 116 since Mar 2012
Thanks Given: 16
Thanks Received: 67


vegasfoster View Post
I've never drawn tools in ascil before, so I would just draw two lines and fill them. The lines will be draw from the current index, but you want to go back, so I think you can create a custom index just for previous 3 bars and make two additional lines that are equal to the current lines. Never done it before though, so you will have to try it out, but I'm thinking something like:


 
Code
Line1[sc.Index] = desired formula;
Line2[sc.Index] = desired formula;

Int Index = sc.Index;

for(int i = 1; i<=3; i++)
{
Line3[Index-i] = Line1[sc.Index];
Line4[Index-i] = Line2[sc.Index];
}
The lines will overlap starting on the current index, but I don't think that will cause problems. If you don't want to use lines, then you will have to study up on the tools, cuz I can't help you there, and I'm sure there is a better way to do it if someone else wants to chime in.

@vegasfoster

Thanks for the idea, i understand what you are talking about now, will get to work coding then Thanks

Reply With Quote
  #7 (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

Yeah, I would go with filled lines because then you won't be limited to the number of instances, whereas the tool will slow you down the more you add. I did this quickly as a proof of concept, need to flesh it out, but it seems to work ok.

Attached Files
Elite Membership required to download: Test.cpp
Reply With Quote
The following user says Thank You to vegasfoster for this post:
  #8 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 351
Thanks Received: 1,126

Vegas, If you do tools correctly, they should not be slowing you down.

Reply With Quote
  #9 (permalink)
Amnesia
Vienna Austria
 
Posts: 116 since Mar 2012
Thanks Given: 16
Thanks Received: 67

@aslan

Yeah they shouldn't.

There are two things about the code i still don't understand yet:

1) "if (sc.Index > 5)"

This will essentially skip the first 6 bars, given that the currentbar is indexed at sc.index = 0,

Is this necessary? Cant we just start calculation from the first bar on given that the
 
Code
{
		
	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];


Code calculates backwards anyways?

2)
 
Code
int Index = sc.Index;
	
	for(int i = 1; i<=2; i++)
	{
		Plot2[Index-i] = Plot1[sc.Index];		
	}
This loop, why does it simply count to two and thus sets the values of index-1 and index-2 i.e the two bars before the current indexed bars to the same value as the current indexed bars?

What is the point of this or why is this crucial/necessary for the code to work?

Reply With Quote
  #10 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 351
Thanks Received: 1,126


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.

Reply With Quote





Last Updated on June 25, 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