SQX137RC4: Strategy template parameters error

For testing some strategy templates problem I made simple RSI strategy template.

RSI is used for entry and for exit.

Both RSIs has randomly set Perid and Level.

So I expect parameters RSIPeriod1, RSIPeriod2, RSILevel1 and RSILevel2.

But RSILevel1 and RSILevel2 are missing.

=======================================================

In pseudo code is:

//--------------------------------------------------------------------

//  Strategy Parameters

//--------------------------------------------------------------------

int MagicNumber = 11111;

double ATR = 0;

int RSIPeriod1 = RSILower1;

int RSIPeriod2 = RSIHigher1;

int ATRPeriod1 = 14;

int ExitAfterBars1 = 15;

double StopLossCoef1 = 3;

….

//--------------------------------------------------------------------

// Trading rule: Trading signals (On Bar Open)

//--------------------------------------------------------------------                  

LongEntrySignal = (RSI(Main chart,RSIPeriod1, PRICE_CLOSE)[1] < RSILower1);


 

ShortEntrySignal = false;


 

LongExitSignal = (RSI(Main chart,RSIPeriod2, PRICE_CLOSE)[1] > RSIHigher1);


 

ShortExitSignal = false;


 

=======================================================

RSILower1 and RSIHigher1 are block identificcation. Not parameter.


 

Formula:

int RSIPeriod1 = RSILower1;

int RSIPeriod2 = RSIHigher1;

is bad.


 

Information in editor for entry signal is:

RSI( Random(RSILower1, 2:4:1)[1] < Random(RSILower1, 21:27:2)

but it should be:

RSI( Random(RSIPeriod1, 2:4:1)[1] < Random(RSILevel1, 21:27:2)


 

Exit signal has similar problem.


 

Attachments
StTm_RSI2_1_Base_R_Long_v04.sqx
(6.55 KiB)
image-0.png
(75.06 KiB)
  • Votes +1
  • Project AlgoWizard
  • Type Bug
  • Status Fixed
  • Priority Normal

History

VH
#1

anttropus

19.07.2023 20:04

Task created

E
#2

Emmanuel

20.07.2023 02:25
Voted for this task.
VH
#3

anttropus

20.07.2023 18:45
This is big problem - not only for me.
TT
#4

Tamas

25.07.2023 06:25

Status changed from New to Fixed

Attachment image-0.png added

Attachment image-1.png added

image-1.png
(196.49 KiB)
image-0.png
(31.89 KiB)
Hello Vaclav, 


based on what I see you are using block "RSI is lower than Level". 

The formula is RSI(period) < level, the period and level parameters are randomized.


Level is a constant in Source code. If you want to have it as variable go to Source code - > Parameter variables and switch on Parametrize Constants.

For better understanding see my screenshot.


Tamas



VH
#5

anttropus

25.07.2023 09:43

I don't understand.

Both conditionbloks (RSIHigher.java and RSILower.java) has annotation @Parameter for variable Level.

So Level is parameter.

In form Edit Block is Level shown as a parameter. It is OK.

So Level should be in strategy source code as a parameter.

TT
#6

Tamas

25.07.2023 10:57
RSI(period) < level, where level is a constant=parameter. 

If you want to have it in source code as configurable variable switch on the option from my last comment.


That's all :)

VH
#7

anttropus

25.07.2023 11:54

It should be taken another way.

Levels should be in strategy code as a constant. But should have individual and clear name.

 

But in pseudo code is only:

int LongRSILowerPeriod1 = RSILower1;

int LongRSIHigherPeriod1 = RSIHigher1;

But this is bad:

 a) no one variable for Levels

 b) RSILower1 and RSIHigher1 are names of blocks and has no type definition

 c) name of block is right to use as a variable only in case if block contains only one value (parameter or variable)

     RSI block contains more values

MF
#8

Mark Fric

25.07.2023 13:00

Attachment image-0.png added

image-0.png
(75.06 KiB)
you probably display recommended parameters, that's why you don't see levels. You can configure which types of variables should be parametrized like in the screenshot.


You are right that it shows random identification as a value, this is intentional.


The goal of SQ is not in generating proper and perfect Pseudo source code for strategy templates with randomizable parts, only for final strategies.

Strategy templates are best viewed in AlgoWizard editor.

VH
#9

anttropus

25.07.2023 16:41

I see in source code – pseudo code, MT4, MT5, jForex. All contains formula like this (MT4):

extern int LongRSILowerPeriod1 = RSILower1;

extern int LongRSIHigherPeriod1 = RSIHigher1;

(EL has the same problem, but another formula)

Problems:

 1) no one variable for Levels

 2) RSILower1 and RSIHigher1 are names of blocks and has no type definition

 3) name of block is right to use as a variable only in case if block contains only one value (parameter or variable)

     RSI block contains more values


Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please