Reply

SMA Period Test for crossover not possible?

9 replies

patrick Müller

Subscriber, bbp_participant, 7 replies.

Visit profile

1 year ago #281473

Moin

 

I want to make a simple test on daily under builder which finds the best crossover(close,sma) for long and crossunder(close,sma) for short.

Test from 8 – 250 MA

Is this actually not possible?

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

1 year ago #281488

Hello,

simply setup such system in AlgoWizard.

You can later load into Optimizer to find the best parameters for the cross

1

patrick Müller

Subscriber, bbp_participant, 7 replies.

Visit profile

1 year ago #281505

Hey thanks, I tried in AlgoWizard to create this, there seems to be an error, can you help me? Thanks

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

0

patrick Müller

Subscriber, bbp_participant, 7 replies.

Visit profile

1 year ago #281508

Para:

LONG = ta.crossover(close, SMA)
SHORT = ta.crossunder(close, SMA)

 strategy.entry(‘long’, strategy.long, when=LONG == true != ‘SHORT’)
 strategy.entry(‘short’, strategy.short, when=SHORT == true != ‘LONG’)
 strategy.close(‘long’, when=SHORT == true  == ‘LONG’)
 strategy.close(‘short’, when=LONG == true == ‘SHORT’)

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

1 year ago #281639

Hi,

the strategy is fine seems. The problem is a missing exit. It opens an initial trade which is never exited. Do you plan to reverse an open existing position on the opposite signal?

0

patrick Müller

Subscriber, bbp_participant, 7 replies.

Visit profile

1 year ago #281684

Hi @thommas262

Thank you for your answer.

I think I wrote it wrong.
Better would be: Only long and that with:
LONG = ta.crossover(close, SMA) and close (exit) = ta.crossunder(close, SMA)

How could you implement this? can you help me make a sqx file?

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

1 year ago #281732

Hi,

check the example attached. Simply put the file into Optimized to get the best values for SMAperiodEntry and SMAperiodExit

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

1

patrick Müller

Subscriber, bbp_participant, 7 replies.

Visit profile

1 year ago #281733

Good morning tomas262,

Thank you for the file. I have now spent 3 hours trying to optimize it, but I keep getting the same values for SMAperiodEntry=14 and SMAperiodExit=36.

I happen to know from my backtesting that the most profitable SMA period for AAPL is SMA 30 for entry and SMA 211 for exit. Now I’m wondering if the optimizer is faulty or if I’m doing something wrong. In any case, something doesn’t seem right.

0

patrick Müller

Subscriber, bbp_participant, 7 replies.

Visit profile

1 year ago #281741

Have times everything uploaded

https://share-your-photo.com/c2470b6f79/album

 

 

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

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

1 year ago #281763

Hi,

you can switch the optimizer to manual mode and adjust parameter ranges to what need. In your screenshot you use the “automatic” mode which prevents from finding the setup you need

See the clip attached

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

0

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