Lookback period in Multi Condition Groups
Author: alankhoury
Creation Date: 6/12/2020 2:35 PM
profile picture

alankhoury

#1
I downloaded WL pro today and I am having trouble making a basic backtest. Can someone help me please?

My conditions are:
Sell Short at the close if price is less than or has crossed though today of the 150 day MA
AND
the 5 day EMA is below or has crossed through today the 10 day EMA

Cover position on close if
Price crosses above 150 day ma
OR
5 day EMA crosses through 10day EMA

I just cannot get it to work right and there are variables like lookback periods that I am unsure why they aren't zero.

If someone can help me I would greatly appreciate it.
Thanks
profile picture

Eugene

#2
Welcome to the forums.

QUOTE:
I just cannot get it to work right

How did you determine that? What exactly is "right"? What you cannot get to work exactly? Be precise please.

QUOTE:
there are variables like lookback periods that I am unsure why they aren't zero.

Where is there? The 150-, 10- and 5-day are EMA's lookback periods. You set them according to your trading system's logic. Why do you think they should be zero? There is no such thing as zero-period EMA.
profile picture

alankhoury

#3
Okay for example, on my chart I should have gotten short IWO on Feb 25th and covered at 159 on March 30 this year.

I have the right periods for the MA period field but I am unsure what to put in the lookback period fields. I only want to execute if the current day's closing bar meets the requirements

also

I have set up a number of multi condition groups because I don't know if I need to say crosses below or IS below for the moving average options.
profile picture

Eugene

#4
Now it makes sense. Yes, MC Groups is where one can find a "lookback period". It shouldn't be zero. In your case, there should be 2 MCGs with "Req'd conditions" and "Lookback period" both set to 1.

Provided you load enough data (say at least 300 bars) you will get the short sale on 02/25 which is covered exactly on 03/30 by this strategy (see image). With the only fix to your rules being "5 day EMA crosses through above 10day EMA"- I think this was a typo. The Rules should be set as follows:



profile picture

alankhoury

#5
thank you for this! i have it working now. Much appreciated
profile picture

Eugene

#6
Glad I could be of assistance.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).