READ-ONLY

The forum is now a read-only archive.

For bug reports & platform questions → [email protected]

Our community lives on Discord and YouTube — come join us!

Trend check Multiple Timeframes

3 replies

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

8 years ago #203466

To check the trend you need different time frames.
I have created a test file, but it does not work … No long order will be opened.
In the strategy tester “M5” is chosen.

I use different MA`s in H1 and M5.
My example:
Go long (H1): SMA 9 SMA100 crosses up
and
M5: Close 1> Upper Bollinger Band

my code:
// go long

IF (((Market Position () is Flat)
And ((SMA (PERIOD_H1, 9, Close) [1] Crosses Above SMA (PERIOD_H1, 100, Close) [1])
And (Close (PERIOD_M5) [1]> BollingerBand_Upper (PERIOD_M5, 20, 2, 0, Close) [0]))))
THEN
Buy 0.1 lots at Market
Magic number = 1000;

END IF;

Why does not this work? How can I use multiple time frames?
Best regards and thanks for a solution

0

Tomas Matejka

Administrator, sq-ultimate, 2 replies.

Visit profile

8 years ago #203508

Hello,

try to change BollingerBand_Upper (PERIOD_M5, 20, 2, 0, Close) [0] to BollingerBand_Upper (PERIOD_M5, 20, 2, 0, Close) [1]

You can also attached ZIPped Wizard project file

0

Uwe6000

Subscriber, bbp_participant, community, 27 replies.

Visit profile

8 years ago #203654

Hello, here´s my file…

Attachments:
You must be logged in to view attached files.

0

Tomas Matejka

Administrator, sq-ultimate, 2 replies.

Visit profile

8 years ago #203685

I believe the problem is SMA cross never meet Close > Bollinger Band. You need to modify entry rules

0

Viewing 3 replies - 1 through 3 (of 3 total)