not closing orders
I am sure I am making a dumb mistake somewhere but cannot seem to find it. I am trying to get this to close orders when price reaches LWMA240 but cannot seem to make it work.
Please let me know what I need to change so it works.
I don’t have the custom indicator so I couldn’t test it for you but here is my fix.
I noticed you used the “ask” price for measuring the cross over. I don’t think that was the issue but you should use “Bid” for short *exits* and “ask” for long *exits*. The opposite for entries
For long trade exits I use the low (current candle’s low) for an exit and high for short trades. High/Lows are the simplest in my opinion.
You can use high/low for bar closing.
Let me know how it goes.
Should work assuming it enters the market and the magic numbers are correct. Run it on MT4 backtest and watch it trade in visual mode.
When you download mine, rename it, so you don’t lose your old one, not that the changes are very much.
Thanks. I tried it though and it still doesn’t close the orders. This is driving me crazy
You watched it trading with the LWMA in your MT4 folder, and all indicators turned on to actually observe the EA trading and witnessed these crosses yourself without an exit?
Here a PIC. I have to fix the entries, but I think I can do that. As you can see price crossed the LWMA 240 and the orders did not close.
Yes, the first entry shouldn’t have been entered since its a sell order and its already above the LWMA. I would add a entry filter:
You can use this on a lower timeframe as well by applying the close to maybe a m15 candle and keep the LWMA on the H1.
Its hard for me to say exactly what the problem is right now. I only briefly looked over the EA. I think it has to do with the entries but I didn’t give it a thorough run through, nor was I able to watch it trade.|
Mark will know what to do.
I had such problems in the past. After changing custom indicator shifts and observing their behaviors, I found that custom indicator shifts are not the same as platform or EA Wizard shifts. Platform and EA Wizard shifts decrease as a negative value into the future, but custom indicator shifts increase in value into the future. In other words, the shift  on the chart is the 2nd bar into the past and  is the current bar. However, custom indicator  is a shift that has not occurred. Within your custom indicator (LWMA 240) code, change the shift value to (-1), which is the last value within the properties line of code. (((((Therefore, the platform shift  will be using the (LWMA 240) shift of (-1)… Both the platform and the custom indicator will be using the same bar for closing…)))))
For instance, attach the custom indicator called Alligator to the chart… I think the shift settings are 8, 5, and 3… Now, change the shifts in the Alligator indicator’s properties to -8, -5, and -3, and see what happens on the chart…
It looks like I fixed the closing orders part. I changed it to Bid<=MovingAverage(…) etc.
However, my entries are screwed up. I am trying to enter when price passes an extreme of ATR channels and then starts coming back. For output I use Ch2up_Buffer3 but the ea open the order based on MA_Buffer0. regardless of what I select for output. The indicator is attached. It is correct in the data window but I cannot make the EA use the correct channel.
There is another custom indicator that is not included, so I could not test the strategy.
But you have the output setting correct buffer. So I can’t test to find what you mean by it using buffer 0 instead of buffer 2 like you want.
Since I cannot seem to get any part of this strategy to work using EA Wizard even after dumbing it down as much as I could, I posted a new topic asking for help on both entries and exits –see EA help needed not following trade rules.
I explained the strategy and posted PICS and indicators.
Viewing 10 posts - 1 through 10 (of 10 total)