SQX – ADX Problem
3 replies
sbecm
4 years ago #241154
Hello
I’m trying to implement a strategy where the adx is below a level 30, but i cant seem to do it how i want.
If i select only the ” ADX is lower than level ” in predifined signals and i make sure i only have 1 entry condition set.
If i select either long or short only trading direction then the strategies are created how i want.
Code snippet below:
//——————————————————————–
// Trading rule: Trading signals (On Bar Open)
//——————————————————————–
LongEntrySignal = (ADX(Main chart,14) < 30);ShortEntrySignal = false;
LongExitSignal = false;
ShortExitSignal = false;
//——————————————————————–
// Trading rule: Long entry (On Bar Open)
//——————————————————————–
if LongEntrySignal
{
// Action #1
Open Long order at (Close(Main chart)[1] + (1.10 * ATR(Main chart,40)[1])) Stop;
Order valid for 1 bars;
Duplicate trades – disabled
Replacing pending orders – allowedStop Loss = 2.3* ATR(20);
Profit target = 2.3* ATR(20);}
BUT if i select both long and short development the adx parameters change and adx changes to (ADX < 70) instead of (ADX < 30) as below in the code:
//——————————————————————–
// Trading rule: Trading signals (On Bar Open)
//——————————————————————–
LongEntrySignal = (ADX(Main chart,14) < 30);ShortEntrySignal = (ADX(Main chart,14) < 70);
LongExitSignal = false;
ShortExitSignal = false;
IS there a way to force both Long and Short Entry to be ADX < 30 ?
Thankyou
tomas262
4 years ago #241163
Hi,
under Builder – What to build tab -> Trading directions -> Disable “Entry symmetry”. When enabled SQX automatically creates symmetrical rule for the short side
sbecm
4 years ago #241178
Hi Tomas Thankyou for your reply.
I’ve done that and it does produce trades where both Long and Short Entry are ADX < 30.
However with the Entry Symmetry Disabled i dont seem to be able to produce trades that im looking for.
Is there another way to go about this ?
For example, if i wanted a strategy where entry signal is not symmetrical but trade entry is as below:
LongEntrySignal = (ADX(Main chart,14) < 30);
ShortEntrySignal = (ADX(Main chart,14) < 30);
//–
Open Long order at Highest(Close, 10) Stop;
Open Short order at Lowest(Close,10) Stop;
Thankyou
tomas262
4 years ago #241326
Currently the only way around this would be setup rules using built-in Algowizard,
Viewing 3 replies - 1 through 3 (of 3 total)