Renko in Matlab - proper - Matlab, R project and Python | futures io social day trading
futures io futures trading


Renko in Matlab - proper
Updated: Views / Replies:3,928 / 7
Created: by cpi65 Attachments:6

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
 
Thread Tools Search this Thread
 

Renko in Matlab - proper

  #1 (permalink)
Elite Member
UK
 
Futures Experience: None
Platform: -
 
Posts: 155 since Aug 2010
Thanks: 12 given, 74 received

Renko in Matlab - proper

HoHoHo!!

So here is my festive contribution to the forum. I know there are renko bits in matlab hanging around already, but they weren't what I wanted so I wrote my own. I used the ES tick data from this site to write the code, and they include "wicks" and proper treatment of "gaps".

The graph one draws a graph, but is only really useful to check the code you've written. I've commented out some moving averages and Donchian channels.

The Data one does the same function as the graph one, except that it produces an HLCO**** matrix so you can backtest easily.

**** check this... for the graph one you might need the financial toolbox because it in effect draws candlesticks with renko data. The candle code in matlab is HLOC. If you don't have the financial toolbox.. err... try and convert it to Octave? Im not into computer stuffz so you get what you see.

(I think when I run it I take out all the redundant ticks in SQL before importing that data into matlab, thats a beast of a task. you might wanna do that too).




As you can tell I'm not a programmer I just crack on until I get what I want, so it can probably be made quicker. but dont ask for any help because im not a programmer, I put it in notepad so you can see what the code is before you run it :-)

Merry Christmas everyone!

Attached Files
Register to download File Type: txt RenkoChart.txt (8.0 KB, 101 views)
Register to download File Type: txt RenkoData.txt (7.6 KB, 62 views)
Reply With Quote
The following 4 users say Thank You to cpi65 for this post:
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received



cpi65 View Post
HoHoHo!!

So here is my festive contribution to the forum. I know there are renko bits in matlab hanging around already, but they weren't what I wanted so I wrote my own. I used the ES tick data from this site to write the code, and they include "wicks" and proper treatment of "gaps".

The graph one draws a graph, but is only really useful to check the code you've written. I've commented out some moving averages and Donchian channels.

The Data one does the same function as the graph one, except that it produces an HLCO**** matrix so you can backtest easily.

**** check this... for the graph one you might need the financial toolbox because it in effect draws candlesticks with renko data. The candle code in matlab is HLOC. If you don't have the financial toolbox.. err... try and convert it to Octave? Im not into computer stuffz so you get what you see.

(I think when I run it I take out all the redundant ticks in SQL before importing that data into matlab, thats a beast of a task. you might wanna do that too).




As you can tell I'm not a programmer I just crack on until I get what I want, so it can probably be made quicker. but dont ask for any help because im not a programmer, I put it in notepad so you can see what the code is before you run it :-)

Merry Christmas everyone!

do you have test data?

Causality is the relationship between an event (the cause) and a second event (the effect), where the second event is a consequence of the first.
Reply With Quote
 
  #4 (permalink)
Elite Member
UK
 
Futures Experience: None
Platform: -
 
Posts: 155 since Aug 2010
Thanks: 12 given, 74 received


wh View Post
do you have test data?

The code was develped on the ES tick data available in the downloads section, so that is your best bet to get to grips with it.

Reply With Quote
 
  #5 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received


cpi65 View Post
The code was develped on the ES tick data available in the downloads section, so that is your best bet to get to grips with it.

OK, that was my error with Z as input. Which matlab version do you use? It is an adaption of the included Renko in the new version. If receive some errors in my matlab 7.5. but will look and fix the next days.

So my plot is empty.

Causality is the relationship between an event (the cause) and a second event (the effect), where the second event is a consequence of the first.
Reply With Quote
 
  #6 (permalink)
Elite Member
UK
 
Futures Experience: None
Platform: -
 
Posts: 155 since Aug 2010
Thanks: 12 given, 74 received

It isn't anything to do with the Renko included in Matlab, I built it from scratch from 2009a. The syntax is the same for both.

For example, the code

RenkoSixGraphB(Z, uBox, dBox);

means

Z = the .mat file with the raw data in. It shouldn't matter about what is contained in it, as long as the third column

[Y = Z(:,3);]

Is the price the contract traded at.

uBox = the threshold (in ticks, so 0.25 = 1 tick for ES futures) for a new upBox to be printed
dBox = same as above, but for downticks

Note that I run the raw data through SQL before I put it through the code in Matlab and take out all the prints at the same price as before (i.e. no change, so Renko ignores them), this is for the sake of resources. There is the code in there to check for it:


Quoting 
%% Get rid of the repeating ticks

numPointsY = length(Y);
y = zeros(numPointsY, 1);
x = zeros(numPointsY, 1);

for j = 2:numPointsY;
if Y(j) == Y(j-1);
y(j) = 0;
else
y(j) = Y(j);
end
end
x = y(y~=0);


My M-files go through the columns:

Date; Time; Price; Size; Change; Ref (= the number of the print from the original file).

** it could well be that, if you don't have the financial toolbox, the "candle" function isn't there to draw the graph. Have you tried with the Data one? This just produces an M-file with HLCO for each particular renko box.

Reply With Quote
 
  #7 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received

here is my simple version (quick and dirt):

 
Code
                            
function [openr,highr,lowr,closer] = wh_renko_bar(close)

brick abs(close(2:end) - (close(1:end-1)));
brick median(brick)

rclose = (close);
len length(rclose);

1;

%
preallocate

for k=1:len
   
if(k==1)
      
up(k) = rclose(k);
      
down(k) = rclose(k);
      
pos(k) = 0;
     
   else
        if(
rclose(k) > (up(k-1) + brick))
            
up(k) = up(k-1) + brick;
            
down(k) = up(k-1) - brick;
            
            
            
openr(z) = up(k);
            
highr(z) = up(k);
            
lowr(z) = down(k);
            
closer(z) = down(k);
            
1;
            
        elseif (
rclose(k) < (down(k-1) - brick))
            
down(k) = down(k-1) - brick;
            
up(k) = down(k-1) + brick;
           
            
            
openr(z) = down(k);
            
highr(z) = down(k);
            
lowr(z) = up(k);
            
closer(z) = up(k);
            
1;
            
        else
            
down(k)= down(k-1);
            
up(k) = up(k-1);
               
            
        
end
     
   end
   
end 
then call in a main function like

 
Code
                            

figure
;

[
ao,ah,al,ac] = wh_renko_bar(dclose)
candle(ah',al',ao',ac'); 

Causality is the relationship between an event (the cause) and a second event (the effect), where the second event is a consequence of the first.
Attached Thumbnails
Renko in Matlab - proper-untitled.png   Renko in Matlab - proper-untitled1.png  
Reply With Quote
The following 2 users say Thank You to wh for this post:
 
  #8 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received

here is my updated version

call in a main routine:

 
Code
                            

 
dclose 
= (quotes.eurusd(:,4));
tick 0.0001;

mult 1;
[
ao,ah,al,ac,brick] = wh_mrenko_bar(dclose,tick,mult);

 
wh_candle(ah,al,ao,ac,'k'); 

Causality is the relationship between an event (the cause) and a second event (the effect), where the second event is a consequence of the first.
Attached Thumbnails
Renko in Matlab - proper-untitled.png  
Attached Files
Register to download File Type: m wh_mrenko_bar.m (2.6 KB, 53 views)
Reply With Quote
The following 3 users say Thank You to wh for this post:

Reply



futures io > > > > Renko in Matlab - proper

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference in the regular Renko charts and the Median Renko charts PamH NinjaTrader 17 February 21st, 2012 08:16 PM
matlab c# wh The Elite Circle 3 June 14th, 2011 09:22 PM
Matlab and ESignal MXASJ Matlab, R project and Python 3 July 29th, 2010 08:43 AM
proper etiquette on posting stephenszpak Feedback and Announcements 2 July 24th, 2010 01:50 PM


All times are GMT -4. The time now is 12:36 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-16 in 0.12 seconds with 20 queries on phoenix via your IP 54.226.113.250