Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hi, can someone please help me on the code below? I am testing a strategy using MACD indicators based 5 min chart (data1) and 30 min chart (data2). For the statements below, I am sure the first one will calculate MACD based on 12 and 26 bars of 30 min. However, Easylanguge does not allow me to specify something like "MyMACD2 of data2". If I keep the second statement as below, the length of 9 implies 9 of 30min bar or 9 of 5min bar? If it implies 9 of 5min bar, is it ok to change it to 54? Any other workaround? Thank you!
MyMACD2 = MACD( Close of data2, 12, 26);
MACDAvg2 = XAverage( MyMACD2, 9);
Can you help answer these questions from other members on NexusFi?
I'm not a EL expert but I believe that can be done as long as you're using time based charts. I use tick charts so no way to use multiple TF's.
I know this isn't a lot of help and hope it's OK with FutureIO. Since you're looking for something Tradestation specific I would ask this on the TS forum, if you haven't already. They have a lot of knowledgeable folks on there and support staff for programming Q's.
You can tie your variables to either Data1 or Data2 in the Declarative Statements. In the code below, I have tied both MyMACD2 and MACDAvg2 to Data2. Also, I have specified in the code that the functions
MACD and XAverage are to operate on Data2. However, even though the calculations are performed on Data2, the "next bar" in the buy and sell entry/exit statements refer to the next bar of Data1 as trades are always executed on Data1.
View the EasyLanguage Print Log to see the Printed messages. New lines will be added to the messages if a Data2 bar has closed and either a cross above or a cross below has happened.