fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Darrow
    3. Posts
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 20
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by Darrow

    • RE: Modify pending order after condition met once

      @l-andorrà Thanks for your recommendation. I have changed the MA_cross variable to two boolean variables, namely 'MA_cross_buy' and 'MA_cross_sell'.
      This is the updated project:
      https://fxdreema.com/shared/WjmtonxDb

      For point 2, I have tested the EA and I get the same outcome.
      0_1601816811312_Pic 21.PNG
      I believe this is because variable 'MA_cross_sell' is not able to be reset back to 'false' after the 'if trade' condition is met.

      The EA bought at 03:00 and closed with SL at 03:12. There is a 12 mins window for the EA to detect any trade (the 'if trade' condition) and then reset the 'MA_cross_sell' to false.
      This is quite odd. What do you think could be causing the error here?

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà The logic seems alright but it still did not work out the way i want it. My project:
      https://fxdreema.com/shared/ZPsLbKjAb

      In this example: Selling signal detected at 2020.01.16, time 03:00

      1. Expectation: The EA to open an sell stop order based on previous low.
        Reality: The EA opened an sell position instead.
        0_1601690279660_Pic 17.png

      2. Expectation: There should not be any more sell order to be created after the sell position at 03:00. According to 'If trade' logic, the variable 'MA_cross' would have been turned to 0.
        Reality: The EA still opened a sell stop order/sell position as if 'MA_cross' is still in value 2.
        2 sell order/sell position opened, as shown.
        0_1601695024968_Pic 19.PNG
        0_1601695066046_Pic 20.png

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà All the while, I am using a buy setup as an example. The reason I set 'MA_cross' to 2 because I am going to use the same variable for selling signal.
      This is the updated project:
      https://fxdreema.com/shared/5sVJ5wWeb

      0_1601607617783_Pic 16.PNG
      I have added mirrored condition for sell setup.
      So when 'MA_cross' = 1, buy signal triggered
      When 'MA_cross' = 2, sell signal triggered
      When 'MA_cross' = 0, waiting for waiting to MA cross to happen (either buy or sell)
      I should have added this portion in my previous project. I apologize for the confusion.

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà This is my updated project:
      https://fxdreema.com/shared/oKcYdYsQc

      Is this what you mean by reverse crossing? For my case, I set the variable 'MA cross' to 2 when 20 MA crosses below 5 MA (the opposite condition for selling setup).
      Or do I have to set it to 0?

      0_1601542508357_Pic 15.PNG

      As for the connection between block 27, 21, 28, I only need one of the conditions to be true to reset the variable:

      1. When there is trade
      2. When 'change' = 'max change'

      Note both variables 'change' and 'MA cross' are reset to zero here

      For example, buy stop may have been triggered before the 'max change' is reached.
      Or buy stop is not triggered but 'max change' reached
      Please correct me if I am wrong here.

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà Thank you for the solution. I am definitely on the right track now.
      This is my current project, with boolean variable implemented:
      https://fxdreema.com/shared/uDRvr9Fzb

      When MA cross + pullback occurred, variable 'MA cross' gets modified to 1
      When there is a trade detected or more than 3 modification of pending order occurred, variable 'MA cross' gets modified back to 0

      It works now, at least it did what I wanted this time.
      Result:
      0_1601456652788_Pic 12.PNG
      0_1601456968258_Pic 13.PNG

      However, there are 2 hiccups:

      1. From the table of results, the next buy order was opened at timing 09:18. I was expecting it open the buy stop order at timing 09:15.
      2. After the trade was closed due to hitting SL at timing 09:28, the EA immediately opened another buy stop order at that same timing. I thought variable 'MA cross' would be turned 0 when there is a trade detected.
        0_1601457226859_Pic 14.PNG
      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà Sorry, it seems that I am back to circle again. I noticed this problem back then and I said in below post.

      The MA crossing is dynamic. This means that, for every new bar is formed, the occurrence of crossing is shifted back. How do I make it such that the crossing is fixed as reference? I want that the condition (crossing) to be met once then take action (either open new order or modify order).

      @darrow said in Modify pending order after condition met once:

      @l-andorrà Below is the updated project. I only changed the buy pending order offset to zero for easier visualization.
      https://fxdreema.com/shared/TyrVeu5ub

      Example:
      0_1600425807734_Pic 5.PNG
      The EA is placing the buy stop order and SL correctly after it detects the MA crossing between candle #2 and 3 as well as a followup pullback candle #1.

      After 1 candle bar later:
      0_1600426454964_Pic 6.PNG
      After 1 candle bar later, the buy stop order did not get triggered and was then removed. The EA should place a new buy stop and SL to the new candle #1. However, the EA did not place any order.

      I believe this is because the MA crossing condition is not met. After 1 bar later, the MA crossing now occurred between candle #3 & 4 while the EA is tasked to check if there is MA crossing occurring between candle #2 & 3.

      More info:
      Currency pair: EURUSD
      Timeframe: 15 min
      Time occur: 2020/01/16, between 9 - 9.15AM
      Below shows that there is no new order after the deletion.
      0_1600426987918_Pic 7.PNG

      I hope this helps explaining my obstacle 😃

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà This is my project:
      https://fxdreema.com/shared/t5kgu1DId

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà Sorry to get back to you late. I have tried the 'check trade count' method. What happened is that the EA opens and deletes the orders within candle #1 timeframe until the beginning of candle ID#0. It supposed to keep on opening and deleting in candle #0 timeframe.

      Candle #1 timeframe: 9:00 - 9:15
      Candle #0: 9:15 - 9:30

      I am reusing this picture to indicate which candle is candle ID #1 and #0
      0_1601025349803_Pic 6.PNG

      Actual screenshot:
      0_1601025602993_Pic 8.PNG

      The result:
      The result shows that the ‘opening & deleting' process ended at the beginning of candle #0
      0_1601025653103_Pic 9.PNG

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà Thank you for getting back. I would not want to have many trades on the same bar either. Is there another way around? or perhaps that is out of the capability of this builder.

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà I wish to clarify and align again. I want the pullback candle to occur right after the cross, not somewhere after the cross happened.

      For example, cross occurred at candle ID #2, if pullback candle occurred at candle ID #1 then place pending order. If they are not connected, then it’s not a valid setup.

      Are we on the same page? 😃

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà However, what I wanted is MA 5 crossing above MA 20, not MA 5 being above MA 20. This is the condition. I want this condition be fixed as I will be using it as reference to modify the buy pending order later on. I hope this clarify one of my conditions.

      Perhaps this can be done is:

      1. Check if any MA crossing occurred
      2. If yes, raise flag
      3. Check if flag is raised
      4. If yes, check for pullback candle
      5. If yes, place buy pending order
      6. If buy pending order triggered, reset flag
      7. If buy pending order not triggered, delete pending order
      8. Repeat Step 4 to Step 8, repetition to be capped at maximum 3 times

      I haven't explored the flags feature. Do you think it can be done this way? Or maybe there is an easy way? =P

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà Below is the updated project. I only changed the buy pending order offset to zero for easier visualization.
      https://fxdreema.com/shared/TyrVeu5ub

      Example:
      0_1600425807734_Pic 5.PNG
      The EA is placing the buy stop order and SL correctly after it detects the MA crossing between candle #2 and 3 as well as a followup pullback candle #1.

      After 1 candle bar later:
      0_1600426454964_Pic 6.PNG
      After 1 candle bar later, the buy stop order did not get triggered and was then removed. The EA should place a new buy stop and SL to the new candle #1. However, the EA did not place any order.

      I believe this is because the MA crossing condition is not met. After 1 bar later, the MA crossing now occurred between candle #3 & 4 while the EA is tasked to check if there is MA crossing occurring between candle #2 & 3.

      More info:
      Currency pair: EURUSD
      Timeframe: 15 min
      Time occur: 2020/01/16, between 9 - 9.15AM
      Below shows that there is no new order after the deletion.
      0_1600426987918_Pic 7.PNG

      I hope this helps explaining my obstacle 😃

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà Thank you for showing me the way. I can understand how your example works. Just delete those orders that aren't triggered at every start of bar and start a new order after that.

      This is my updated project:
      https://fxdreema.com/shared/RPbeu7iec

      During the testing, I noticed that it didn't modify the order when the candle closed lower than previous candle. I believe the reason is due to MA crossing being dynamic.

      When the order didn't get triggered and deleted at the start of new candle, the condition for MA crossing at candle ID #2 is not valid anymore. This time, the MA crossing has shifted backward to be candle ID #3.

      How do I fixate on the MA crossing while the deleting/opening (modifying) new order for at most 3 times? I have found other post in the Fxdreema forum, in this kind of situation, do we use flags?

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà Yes, I want it to modify buy stop and SL if candle's high closes below previous candle's high.

      You are right. I am still familiarizing with the logic and how to use Fxdreema. I have found bits and pieces info from other Fxdreema forum posts but couldn't find one related to my topic.
      As a start, to limit the number of changes, do I start building the block in the "on Trade" event, instead of "on Tick"?

      0_1600259658571_Pic 4.PNG

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      @l-andorrà Thank you for your reply. I have updated the pic again to add in candle #2,1,0.
      The buy stop and stop loss will be placed on candle #1. Hope this explains the matter.

      0_1600146353734_Pic 3.PNG

      posted in Questions & Answers
      D
      Darrow
    • RE: Modify pending order after condition met once

      This is the illustration of the strategy:
      0_1600065156331_C4815C57-55F8-4E9D-BC67-0BDB7DEE3A17.bmp
      0_1600065167077_070155FF-1C14-4514-BA55-DC378DE04030.bmp

      posted in Questions & Answers
      D
      Darrow
    • Modify pending order after condition met once

      Hi, I would like to seek guidance on how to setup below instruction.

      Flow:

      1. Condition: MA crossover occurs
      2. If condition in step 1 is met, it waits until the next candle to form.
      3. If the next candle closes below previous candle, we place a buy stop order above the high this candle (which just recently close).
      4. If the next candle after this candle closes below again, it will modify the buy stop order to the above of this new candle.
      5. If this modification occurs 3 times, then the trade setup becomes invalid (It won't modify for the forth time). It will look for another trade setup.

      This is my current project (for buy only):
      https://fxdreema.com/shared/PXr8vAete
      It is incomplete because I am stuck on the mainly 2 problems:

      1. I wish to know how to modify a pending order when the next candle formed after a condition is met once.
        Besides that, I am referring to another similar post in fxdreema when making this EA. This is the post:
        http://fxdreema.com/forum/topic/7364/pending-order-adjust/8
        My situation is similar to this post but my condition only need to be met once. In my case, its the MA crossover.
      2. Is there a way to limit the number of modification? In my case, I wish to limit to maximum 3 modification only.

      I am newbie to fxdreema. I am still learning how to workaround it. Would appreciate it if someone can shed some light on my problems. Sorry, my English isn't good, please let me know and i will clarify on anything that is unclear.

      posted in Questions & Answers
      D
      Darrow
    • 1 / 1