Systems Workshop: "Buttonwood" E-mini daytrading system

Post anything related to mechanical systems and automated trading here.
Post Reply
Simon.B
Posts: 91
Joined: Thu Jul 23, 2015 8:26 pm
Contact:

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by Simon.B » Fri Oct 23, 2015 2:33 am

Hi Earik,

I wasn't suggesting using stops or targets, just wanted to know if you feel the same way about those on intra-day system.

Thanks,
Simon

orionsbelt
Posts: 33
Joined: Tue Jul 21, 2015 9:19 pm
Contact:

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by orionsbelt » Sat Oct 24, 2015 8:31 pm

i still can't get the Buttonwood_v4 technical indicator to load on an intraday es chart. i have uploaded all of the previous buttonwood v1-4 scripts/functions and "replaced" the individual scripts/functions as prompted with each newest version up to v4. i get the following error message:

FATAL ERROR: in buttonwood_index_progressedtonatal_v2, somewhere near line 18
Illegal opcode in script! (379)

which when i open the script it is this line 18
nt = 852 - timezone*100; #adjusted to local time

any suggestions?
thanks

User avatar
earik
Site Admin
Posts: 474
Joined: Mon Dec 01, 2014 12:41 pm
Contact:

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by earik » Sat Oct 24, 2015 8:42 pm

Hi orionsbelt,

The timezone keyword is relatively new. You need to get on a newer version of w59 compared to what you have, and it will work. Go to wave59.com - member login - download, then just install right over the top of what you have now.

Regards,

Earik

NDscorpini
Posts: 200
Joined: Tue Jul 21, 2015 10:34 pm

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by NDscorpini » Sat Oct 24, 2015 9:21 pm

Hi All,
I thought my message got uploaded but apparently not. At any rate, I mentioned to Earik in an e-mail that I am a big fan of TradeStation's 14 bar breakout dots. I know TradeStation is the anti-Christ around here but it is still a good indicator.

If someone were to code an indicator with a variable input for breakouts it may help with this project. Then you could research many Toby Crabel style of breakouts and come up with more than one system for big range days. This could be done in hopes of managing the risk and offset some of the drawdowns. Isn't Larry Williams Oops pattern just a false breakout?

Best wishes,
NDscorpini

orionsbelt
Posts: 33
Joined: Tue Jul 21, 2015 9:19 pm
Contact:

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by orionsbelt » Sat Oct 24, 2015 10:06 pm

thanks Earik. i got the buttonwood_v4 indicator to open and run system reports. now, i am attempting to redo what sbanks did with his channel_breakout. so, first i created the "Channel_Breakout" function as follows

Code: Select all

#length: 5
input:length;

if (barnum==barsback) {
    signal=0;
}

high_channel=average(high,length);
low_channel=average(low,length);

if (close > high_channel) {
    signal = -1;
}
if (close < low_channel) {
    signal = 1;
}

return signal; 



and then created a new buttonwood_v4a which has the

Code: Select all

#compute trading signal --------------------------------------

signal1 = Buttonwood_Signal(8,34);
signal2 = Channel_Breakout(5);
signal = signal1 + signal2; 
modified into the original buttonwood_v4 (now saved as buttonwood_v4a) and get the following error when i try to open this indicator on my ES chart

ERROR: in buttonwood_v4a, line 69
+ operator cannot process undefined variables.

where line 69 is the
signal = signal1 + signal2;
from above


suggestions anyone
thanks again, trying to learn so i can help out

sbank
Posts: 174
Joined: Tue Jul 21, 2015 9:35 pm
Contact:

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by sbank » Sun Oct 25, 2015 4:51 pm

orionsbelt wrote:thanks Earik. i got the buttonwood_v4 indicator to open and run system reports. now, i am attempting to redo what sbanks did with his channel_breakout. so, first i created the "Channel_Breakout" function as follows

Code: Select all

#length: 5
input:length;

if (barnum==barsback) {
    signal=0;
}

high_channel=average(high,length);
low_channel=average(low,length);

if (close > high_channel) {
    signal = -1;
}
if (close < low_channel) {
    signal = 1;
}

return signal; 



and then created a new buttonwood_v4a which has the

Code: Select all

#compute trading signal --------------------------------------

signal1 = Buttonwood_Signal(8,34);
signal2 = Channel_Breakout(5);
signal = signal1 + signal2; 
modified into the original buttonwood_v4 (now saved as buttonwood_v4a) and get the following error when i try to open this indicator on my ES chart

ERROR: in buttonwood_v4a, line 69
+ operator cannot process undefined variables.

where line 69 is the
signal = signal1 + signal2;
from above


suggestions anyone
thanks again, trying to learn so i can help out
Did you click on "build Script" for the Channel_Breakout function? It sounds like you followed the steps I did... Maybe take the buttonwood part out of the equation here; create a quick indicator to just graph the result of Channel_Breakout:

Code: Select all

signal = Channel_Breakout(5);
      
plot1=signal;  

orionsbelt
Posts: 33
Joined: Tue Jul 21, 2015 9:19 pm
Contact:

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by orionsbelt » Sun Oct 25, 2015 11:31 pm

thanks sbank, i got it to work now. and just to clarify, channel_breakout needs to be a function and not an indicator correct?
also, what would happen if

Code: Select all

#compute trading signal --------------------------------------

signal1 = Buttonwood_Signal(8,34);
signal2 = Channel_Breakout(5);
signal = signal1 + signal2; 
was changed to

Code: Select all

#compute trading signal --------------------------------------

signal1 = Buttonwood_Signal(8,34);
signal2 = Channel_Breakout(5);
plot1=signal1 + signal2; 
inside the buttonwood_v4 ?
what is difference between plot1 and signal in Qscript?

and can anyone explain where the actual entry signals are taken using the 8/34 MA and the 5 high/low average channel so i can envision it on a chart?
thanks

orionsbelt
Posts: 33
Joined: Tue Jul 21, 2015 9:19 pm
Contact:

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by orionsbelt » Mon Oct 26, 2015 3:58 am

i was trying to create a system that uses the AMA with the channel breakout instead of the average and i want to know if anyone thinks i did it correctly. first i needed to create a "function" for the AMA, correct? so here it is and is it correct? i called it "AMAv1"

Code: Select all

#returns the AMA of "price"

input: price,length,f1,f2,f3;

if (length>0)
{
    avg=0;
    for (i=0 to length-1 by 1)
        avg+=price[i];
    avg/=length;
}
else
    avg=price;

return avg; 
then i changed the middle part of buttonwood_v4 to

Code: Select all

signal1 = AMAv1(8,34,0.5,0.65,0.85);
signal2 = Channel_Breakout(5);
signal = signal1 + signal2;
i was able to get it to plot on a chart but the system results were very poor but i really just want to know if i am approaching this correctly?
thanks

sbank
Posts: 174
Joined: Tue Jul 21, 2015 9:35 pm
Contact:

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by sbank » Mon Oct 26, 2015 5:39 am

@orionsbelt,

To answer your question around signal vs. plot. plot is a reserved word for QScript which plots. (Take a look at the QScript help on it for examples.) The word signal is just something that Earik chose to act as a variable to use to track if we should be short or long. (He could have called it frankfurters if he wanted.)

signal1 and signal2 would be run on every 5-min bar. You can think about it this way, when each bar closes, signal1 and signal2 would be computed:

signal1: 1, 1,1,-1,-1,1,1,-1,etc
signal2: 1,-1,1,-1, 1,1,1,-1,etc
signal (which is just signal1+signal2): 2,0,2,-2,0,2,2,-2,etc

Which leads into your next question. You alluded to making a new function based on AMA. The idea is that signal contains just a buy sell. So instead of returning the contents of the moving average, you should either return +1 or -1. In other words:

Code: Select all

#returns the AMA of "price"

input: price,length,f1,f2,f3;

if (length>0)
{
    avg=0;
    for (i=0 to length-1 by 1)
        avg+=price[i];
    avg/=length;
}
else
    avg=price;

if (avg> 0) {
	signal=1;
}
if (avg< 0) {
	signal=-1;
} 
return signal;
Edit: Note, I did not really investigate what you were doing. So I have no idea if this would work or not. 8-)

supracharger
Posts: 24
Joined: Tue Jul 21, 2015 9:32 pm
Contact:

Re: Systems Workshop: "Buttonwood" E-mini daytrading system

Post by supracharger » Mon Oct 26, 2015 4:01 pm

sBank, orionsbelt,

Since the avg is always going to be bigger than zero, the signal is always going to equal 1, and your function is always going to return 1. If you want to get a buy/ Sell signal from an average the easiest way is to find whether it is increasing or decreasing (getting the slope, finding the derivative). Below I changed your code with the following:

- Andrew

P.S. It is usually better just to use the difference of 2 moving averages (what Earik has done prior) rather than finding if 1 average is increasing or decreasing to get a buy/ sell signal, that way you pull out more noise.

Code: Select all

#returns the AMA of "price"

input: price,length,f1,f2,f3;

if (length>0)
{
    avg=0;
    for (i=0 to length-1 by 1)
        avg+=price[i];
    avg/=length;
}
else
    avg=price;

# Figure out the Slope, to get the buy/ Sell signal, Edited by Andrew ..............................    
dA = avg - avg[1];
if (dA> 0) {
   signal=1;
}
if (dA< 0) {
   signal=-1;
} 
return signal;

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests