Not logged in
Viewing 3 posts - 1 through 3 (of 3 total)

Forums>AlgoWizard / EA Wizard>Make my EA>Can coders help with this support/resistance price code?

  • #262623 |
    Customer
    39 Posts

    I have a simple code I have used in ProRealTime that does a really good job of following the support/resistance troughs and peaks of a trending price:

    PivotBAR = 4
    LookBack = 6
    BarLookBack = PivotBAR+1

    IF low[PivotBAR] < lowest[LookBack](low)[BarLookBack] THEN
    IF low[PivotBAR] = lowest[BarLookBack](low) THEN
    ThirdSupportPrice=PrevSupportPrice
    PrevSupportPrice=SupportPrice
    SupportPrice = low[PivotBAR]
    ENDIF
    ENDIF

    IF high[PivotBAR] > highest[LookBack](high)[BarLookBack] THEN
    IF high[PivotBAR] = highest[BarLookBack](high) THEN
    ThirdResistancePrice=PrevResistanceprice
    PrevResistancePrice=ResistancePrice
    ResistancePrice = high[PivotBAR]
    ENDIF
    ENDIF

    return supportprice, resistanceprice

     

    Is this something could be done with algo wizard to create a custom block that would allow the randomisation of pivot bar and look back parameters maybe?

    Attachments:
    You must be logged in to view attached files.
    #266689
    tomas262
    Administrator
    1535 Posts

    Hello,

    you need to assign prices to ThirdResistancePrice and other variables so you cannot directly create a custom block for all this.

    It is easy to setup a template though that will be used to build new strategies. The parameters can be set to be randomly generated (within pre-define value range)

    Check this https://strategyquant.com/doc/strategyquant/strategy-templates/ and this https://strategyquant.com/blog/introduction-strategyquant-templating-system-part/

     

    #266711
    Customer
    39 Posts

    Thanks Tomas the links were helpful.

    So I put the code together as a template in Algo Wizard as per the code in my original post (short trades only just to start). I’ve attached the file.

    However it does not make any trades. I’ve checked the template and looks OK. Maybe its something to do with how SQX assigns the value in ‘Rule 6’?

    Attachments:
    You must be logged in to view attached files.
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.