Not logged in
Viewing 5 posts - 1 through 5 (of 5 total)
  • #237952|
    Participant
    3 Posts

    Hello,

    I am having an issue in building a protocol within EA Wizard. I am trying to create criteria in which a new order will only be placed if the last order (in closed P/L in Pips) was positive (>0).

    That said, when I use the proper magic numbers, it simply opens new orders anyway. I have also attempted create rules in which a new order will only execute IF it has been more than “X” Bars since last order has closed. Even when I choose some absurd number, orders continue to open regardless.

    Any assistance here is greatly appreciated. This is a simply command and I cannot for the life of me understand what I am doing incorrectly.

    Can you please advise how to program a simple (if last trade is unprofitiable; do not enter another).

    PS*, anytime I get any response, the EA simply doesn’t open a trade because the command concerning last trade remains untrue as their is no standing trade P/L before the first trade.

     

    Thanks in advance!

     

    #237954
    Ilya
    Customer
    95 Posts

    If you upload your strategy file, I’ll try to fix it for you.

    Anyhow, I would add an integer variable named “LastTradeProfit”, which will be set at 1 by default and will serve as an indicator for a profitable last trade.

    then your new trade order would have a “If your long/short trade condition is true AND LastTradeProfit=  1, THEN Execute trade AND LastTradeProfit=0“.

    Then another rule which says “IF Closed P/L (in pips) of your magic number > 0, THEN LastTradeProfit = 1

    If you use a certain magic number, orders won’t be doubled, a first trade will open since LastTradeProfit is set at 1 by default, and a new trade won’t be open if your order closed in a loss since LastTradeProfit will stay at 0.

    (Closed P/L (in pips) Returns last closed P/L for order with given Magic Number, 0 by default)

    Ilya

    #238010
    tomas262
    Administrator
    992 Posts

    Hello,

    use “Closed P/L (in pips)” as Ilya suggested. Let us know if any help or a Wizard sample needed

    #238015
    Customer
    441 Posts

    Hi . I do not code much if I can avoid it which I am pretty good at ( avoiding) However how can this work since it will not take any more trades after it is not allowed to take one ( ever ). Only way would be to run the strategy on a another account as well and send the trade signal there. Or send it to another magic number maybe.

    • This reply was modified 2 months, 2 weeks ago by  mabi.
    #238068
    Ilya
    Customer
    95 Posts

    [quote quote=238015]Hi . I do not code much if I can avoid it which I am pretty good at ( avoiding) However how can this work since it will not take any more trades after it is not allowed to take one ( ever ). Only way would be to run the strategy on a another account as well and send the trade signal there. Or send it to another magic number maybe.[/quote]

     

    This is a very strange concept for me too, but hey, it’s his EA. (Maybe he will reset the deciding variable every day, so each day the strategy will be reset, or something like that).

     

    Ilya

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

You must be logged in to reply to this topic.