Stops/adding variables?
-
For point 1, your 'close' block is recommended to be linked to an upper 'For each trade' block.
For point 2 I would include a new variable identifying the trigger level has been crossed so that no new crosses are allowed.
For point 3 I never recommend to use the == symbol when comparing operands including Ask, Bid, or Mid (see block ID 32). I recommend you use >= instead.
-
@l-andorrà thanks do you know how I would go about using the new variable in a block to tell if its been crossed?
-
@chemdog Okay, there are some things I'd like to mention not knowing if they are all related to the issues you are facing.
- You enable the MyFlag flag once and have a check on it (Block 301 and 302). You never disable it again. That's maybe the reason all close at once if the last candle was the bear candle! Especially as it has no timer or anything else for filtering (before block 302 as 302 not working like this).
Please specify how the trades should be closed again! - There is no check as far as I see, if the triggerLevel is below or above the current price. You only check if price is at triggerLevel. If price moves fast and is just 1 point above, it will not take the trade (Block 32)
- Check profit unrealized if I understand that block correctly sums all profits (and losses) and checks against the value specified in money. Not sure if it would also consider other currency pairs with trades from EA with same magic number. However, that may be your intention - don't know.
- Block 300 doesn't make sense here and you shouldn't re-use the loop variable. The order should be:
a) 297 .. calculate the bar, the current trade (handled by the "for each Trade" block) was opened.
b) do the loop stuff again such as in 25, 27, 28, BUT instead of loop variable you use vi_order_bar variable instead! for the maximum number of loops (5) you need to specifiy another variable that would be vi_order_bar + 5
Does that make sense or did I confuse you?
- You enable the MyFlag flag once and have a check on it (Block 301 and 302). You never disable it again. That's maybe the reason all close at once if the last candle was the bear candle! Especially as it has no timer or anything else for filtering (before block 302 as 302 not working like this).