I need help with distance block
-
I am trying to get it to place a pending order when the current candle (0) has moved a certain distance away from the previous candle's low/high. I want the candle to move the same distance as the previous candle's wick size (in pips) but I can never get it to do exactly that.
It only takes trades with candles with no wicks, which doesn't make sense. I've tried everything for hours and nothing is working.
https://fxdreema.com/shared/k17nOWbtd -
@lwoodruff you are mixing up raw units (0.00001, 0.00002, 0.00003...) and pip units (1, 2, 3...)
This method should work, you need to declare 1 variable https://fxdreema.com/shared/cWggZvXad
-
@roar Do I have everything set up right for buys? https://fxdreema.com/shared/jxOMBhVYc
I pasted what you had and created the wick variable, but now it is just placing orders whenever the candle goes below the previous candle's low. Not the distance of the previous wick. -
@lwoodruff sorry made a mistake, it should be candle low in the circled part

-
@roar Hey, I changed it to "Candle low" but it's still doing the same thing. I also tried to remove the first condition below the time filter I had but it didn't change anything. Can you run it real quick? I appreciate your reply.
https://fxdreema.com/shared/xBcaxj1mb -
@lwoodruff its difficult to see, because your buy order is still placed at candle low.
You can use a Draw line block to visualize the target betterhttps://fxdreema.com/shared/Unr4smtnc

-
@roar Okay so I put the blocks in to draw the target, and it's drawing it at the previous candle's low, not below it but yours is doing the correct thing. I also made the SL bigger to try it out. Do you think it's something to do with my variable?
https://fxdreema.com/shared/v053mIrR

-
@lwoodruff ah yes, its the variable. The datatype needs to be double, not int.
-
@roar Thank you so much! Also, is there a way to just measure the bottom wick? Or have different formulas for both bullish and bearish candles? The candles that close bullish have a long way to go because the close is higher.

-
@lwoodruff we need to first check if the last candle was a bull or a bear, and then calculate the difference either from candle close (bear case) or candle open (bull case)
-
@roar Thank you!! Calculating the wick size and distance is good now. The problem now is that sometimes it takes trades when it's not supposed to. I think it may have something to do with the open order area in my EA but I'm not sure why it's happening.
I don't know how to explain it perfectly but if you run it you should see.
https://fxdreema.com/shared/1DsXv8mZb -
@roar Nevermind, I fixed it, I'm new to variables. Thank you so much for your replies. Do you know how to make the pending order expire after the next candle opens?
-
@lwoodruff once per bar -> delete pending orders