Not logged in
Viewing 4 posts - 1 through 4 (of 4 total)
  • #241154|
    Customer
    10 Posts

    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 – allowed

    Stop 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

    #241163
    tomas262
    Administrator
    1116 Posts

    Hi,

    under Builder – What to build tab -> Trading directions -> Disable “Entry symmetry”. When enabled SQX automatically creates symmetrical rule for the short side

    #241178
    Customer
    10 Posts

    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

    #241326
    tomas262
    Administrator
    1116 Posts

    Currently the only way around this would be setup rules using built-in Algowizard,

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

You must be logged in to reply to this topic.