Reply

SMA Period Test for crossover not possible?

5 replies

patrick Müller

Subscriber, bbp_participant, 5 replies.

Visit profile

2 weeks 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, 1 replies.

Visit profile

2 weeks 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, 5 replies.

Visit profile

2 weeks 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, 5 replies.

Visit profile

2 weeks 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, 1 replies.

Visit profile

1 week 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, 5 replies.

Visit profile

2 days 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

Viewing 6 posts - 1 through 6 (of 6 total)