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

Forums>AlgoWizard / EA Wizard>Application Support>Help with triggering 2nd order

  • #113320 |
    Customer
    87 Posts

    Hello,

     

    I’m having trouble working out how to get the next order after a loss to take a different lot size. 

     

    IF(buy rules)=True

    Then(assign variable) = 1

     

    IF(variable)=1 

    Then(enter buy)

    (assign variable) = 0

     

     

    The above code works all day long. The problem is in the next piece (I think).

     

    IF(closed p/l 0,0) <0

    Then (assign variable) = 2

     

    IF(variable)=2

    && (buy rules) = true

    THEN(enter buy w/larger lot)

     

    This seems to never take the larger trade after a loss. Is there something I’m missing?

     

    Thanks for any help with this issue.

     

    James

    #128799
    Mark Fric
    Administrator
    1182 Posts

    if it doesn’t work it looks like the second two rules are never triggered.

    It depends also on how exactly it is done, if you’ll post the strategy here I can look at it.

     

    You should be aware that rules are evaluated in order they are created, so your first rule always sets the variable to 1, and your second rule then always make a trade.

    Mark
    StrategyQuant architect

    #128843
    Customer
    87 Posts

    Thanks Mark.

     

    I finally reversed the order and the trades execute correctly.

     

    Thanks again.

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

You must be logged in to reply to this topic.