two different intraday data - strategy not working  [SOLVED]

Questions about MultiCharts and user contributed studies.
FutureTrader
Posts: 79
Joined: 28 Mar 2013
Has thanked: 3 times
Been thanked: 4 times
Contact:

two different intraday data - strategy not working

Postby FutureTrader » 02 Feb 2014

I'm not new to EL, but I cannot resolve this problem ...
Could someone have a look on it :)

I'd like to buy on a 1-minute chart when Time=929 and MACD is positive on 240-minute chart. Exit at End of Day.
Data 1: @FDAX, 1 Minute
Data 2: @FDAX, 240 Minute

Code: Select all

inputs:
FastLength(12), SlowLength(26), MACDLength(9);
variables:
var0(0), var1(0), var2(0);

var0 = MACD(Close Data2, FastLength, SlowLength);
var1 = XAverage(var0, MACDLength);
var2 = var0 - var1;

if var2 > 0 and Time=929 then
Buy ("MacdLE.929") next bar at market ;

The problem is:
I get also Buy Signals, when MACD is not positive. See attached chart.
Attachments
1.png
(130.64 KiB) Downloaded 633 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: two different intraday data - strategy not working  [SOLVED]

Postby TJ » 02 Feb 2014

I'm not new to EL, but I cannot resolve this problem ...
Could someone have a look on it :)
I'd like to buy on a 1-minute chart when Time=929 and MACD is positive on 240-minute chart. Exit at End of Day.
Data 1: @FDAX, 1 Minute
Data 2: @FDAX, 240 Minute

Code: Select all

inputs:
FastLength(12), SlowLength(26), MACDLength(9);
variables:
var0(0), var1(0), var2(0);
var0 = MACD(Close Data2, FastLength, SlowLength);
var1 = XAverage(var0, MACDLength);
var2 = var0 - var1;
if var2 > 0 and Time=929 then
Buy ("MacdLE.929") next bar at market ;
The problem is:
I get also Buy Signals, when MACD is not positive. See attached chart.
See post #5
viewtopic.php?f=16&t=6929

FutureTrader
Posts: 79
Joined: 28 Mar 2013
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: two different intraday data - strategy not working

Postby FutureTrader » 02 Feb 2014

TJ thank you for your quick reply. I got it working with your help.
Is this a Multicharts solution only, or is it the same in TS?
And where can I read about exact this topic in the manual from MC? Do you have an link to the documentation/manual?
Thanks again.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: two different intraday data - strategy not working

Postby TJ » 02 Feb 2014

TJ thank you for your quick reply. I got it working with your help.
Is this a Multicharts solution only, or is it the same in TS?
And where can I read about exact this topic in the manual from MC? Do you have an link to the documentation/manual?
Thanks again.
This EasyLanguage syntax convention was defined by TS umpteen years ago.

You can refer to the Wiki for more description and explanation.
https://www.multicharts.com/trading-sof ... /Main_Page

User avatar
MAtricks
Posts: 789
Joined: 09 Apr 2012
Has thanked: 286 times
Been thanked: 288 times

Re: two different intraday data - strategy not working

Postby MAtricks » 02 Feb 2014

For some reason, MC hides these wonderful CHM files deep in the directory..

Image
Attachments
CHM_files.png
(135.7 KiB) Downloaded 763 times


Return to “MultiCharts”