not closing orders

9 replies

deweymcg

Subscriber, bbp_participant, community, 24 replies.

Visit profile

9 years ago #112111

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.

0

Threshold

Customer, bbp_participant, community, 723 replies.

Visit profile

9 years ago #124315

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[0] (current candle’s low) for an exit and high[0] for short trades. High/Lows are the simplest in my opinion.

You can use high/low[1] 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.
Good luck.
When you download mine, rename it, so you don’t lose your old one, not that the changes are very much.

0

deweymcg

Subscriber, bbp_participant, community, 24 replies.

Visit profile

9 years ago #124316

Thanks. I tried it though and it still doesn’t close the orders. This is driving me crazy

0

Threshold

Customer, bbp_participant, community, 723 replies.

Visit profile

9 years ago #124318

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?

0

deweymcg

Subscriber, bbp_participant, community, 24 replies.

Visit profile

9 years ago #124319

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.

0

Threshold

Customer, bbp_participant, community, 723 replies.

Visit profile

9 years ago #124320

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:
IF
Close[1] <LWMA[1](240)
Then sell…
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.

0

Mike H.

Subscriber, bbp_participant, community, 76 replies.

Visit profile

9 years ago #124321

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 [1] on the chart is the 2nd bar into the past and [0] is the current bar. However, custom indicator [1] 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 [1] 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…

0

deweymcg

Subscriber, bbp_participant, community, 24 replies.

Visit profile

9 years ago #124329

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.

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

9 years ago #124335

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.

 

-Stearno

0

deweymcg

Subscriber, bbp_participant, community, 24 replies.

Visit profile

9 years ago #124379

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.

0

Viewing 9 replies - 1 through 9 (of 9 total)