This is a dumb question, but are you running the EA on the same broker that you tested on? There can be a significant difference between brokers, but the EA should NOT read the charts differently in any case.
Posts made by cmuphyfx
-
RE: Help needed. Live trading not working on VPS or locallyposted in Bug Reports
-
RE: Help needed. Live trading not working on VPS or locallyposted in Bug Reports
You could write a simple EA that takes a trade every bar with a 0.01 lot size. See if that executes, if so, you know that EA's are working correctly on MT5. If not, then you might have found the issue. Outside of that, we'd have to see your EA to know what the issue might be.
-
RE: eror market close [10018]posted in Bug Reports
Roar posted about this, you need to loop through positions and use close, vs the general 'Close Positions' block. Pink, not blue.
-
RE: checking 20 previous candles for setting SLposted in Questions & Answers
Consider the edge cases on what the last 5 candles might look like in extreme situations. You may be better off using an ATR value with a modifier coefficient, something like 1.5X the ATR for the last 5 or 10 candles.
-
RE: EA creating two trades instead of oneposted in Questions & Answers
I ended up finding the issue - something I've never seen before. I have 4 once per bar blocks that execute and they were out of order and this is somehow causing my trades 'once per bar' to execute twice? I re-ordered them and this solved the issue. Still a VERY strange issue considering I disable the flags after a trade is place, at the top of my 'once per bar' I have a number of positions check to make sure it's less than 1, and 'on trade' I disable the flags also.

Sorry - thought I fixed the issue with the above renumbering, but it was actually this block... I didn't realize it goes down the logic path two times in this scenario.
I turned off the 2nd condition and I no longer get double trades. Dummy. -
EA creating two trades instead of oneposted in Questions & Answers
Hello,
I have a strange bug in my EA that is somehow creating two positions despite having flags and checks in place so that only one trade should happen.
My EA checks for certain conditions and flags in order to enter a trade. If all conditions are met, it places a trade, resets the flags and moves on. For some reason, it is now creating two positions when the order is sent and I have no idea why. At the top of my logic, I check for position count, it needs to be less than 1 for this group (yes, double checked all the groups are correct) and if there are no positions it goes down and if all logic is passed, it opens a trade (single buy/sell now) and then resets the flags. No idea why, but this is somehow opening 2 trades.
This EA has previously been working and this is suddenly happening... Any chance there has been some alterations to the back end code?
The condition before the two sells is for testing, it's a boolean check to see if I want to use lots or % for the trade. There is NO way that is being executed at the same time.


-
RE: Useful tip for multiple trailing stopsposted in General Discussions
This seems like an interesting approach. Would be nice to see a diagram of the initial order, when the first TS starts and the size, and then when the 2nd kicks in. I struggle with a similar problem - my EA has a nice TS but often it leaves a lot of profit on the table. I use my size as a portion of my initial SL size, so it's dynamic. With only 1 TS it's difficult to capture all (or the majority) of profit.
-
RE: pending ordersposted in Questions & Answers
The best way to handle this is to use flags on candle close. Pending orders are a challenge to deal with, because you have to have checks to make sure that you don't keep opening pending orders and have 100 orders ready to get tagged in. So what I would do, is when you have identified a CHoCH, you identify the entry price and SL level. Once per bar, you should check to see if the last candle high/low was above/below the entry price and then do a market order to enter.
-
RE: News during Backtestposted in Questions & Answers
@Archer I'd love to take a look at this, if possible but the transfer is no longer valid. Do you mind sharing the file again?
-
RE: Trailing Stop at multiple lvlsposted in Questions & Answers
You're going to want to loop through all open trades, check if price is X pips away from open, if so, once-per-trade, modify stops, set to open price of the trade. That's your BE. For the trailing stop, it's a simple block and you have the offset start when price is x pips away from open. Although, I will tell you, this type of EA is VERY unlikely to be profitable. Think about spread, commissions, etc..
-
RE: Liquidity sweep (I am going crazy)posted in Tutorials by Users
I can't edit your project, but you need to create a condition block that checks to see if the high/low today, is higher/lower than yesterday's high/low. If that is true, then you set a flag (call it violation_today) to true. In your logic for actually placing the trade, you need to make sure the flag (violation_today) is true, if so, you can proceed.
-
RE: Trailing stop issuesposted in Questions & Answers
I gave you a suggestion earlier. Have a block that checks to see if your equity is at a percent that you want. If that is true, then you enable the trailing stop.
-
RE: Liquidity sweep (I am going crazy)posted in Tutorials by Users
So you need to set a flag as a condition. Same logic as above, and if price has exceeded the daily high/low you set a flag to true, and then in your other conditions, you check to see if that flag is true and if so, proceed.
-
RE: Trailing stop issuesposted in Questions & Answers
Your trailing stop does not work because you are not giving it accurate information. You need to change the offset parameter to be a price value, not a profit value.
-
RE: News during Backtestposted in Questions & Answers
Wouldn't the most simple solution be to not trade from an hour before the earliest possible time and an hour after the latest possible time? So 11:30 to 14:30 on red folder days? I doubt that missing those extra hours on red folder days destroys an EA during backtesting.
-
RE: Trailing Stop at multiple lvlsposted in Questions & Answers
EA's like this are massive scalping strategies. You'll need to test this with tick data to ensure that it is working properly. 1M OHLC data will show this as a massively profitable EA but in fact it may not be.
The link you posted doesn't open any trades... So, the trailing stop doesn't work. Where is the rest of your logic?
-
RE: Liquidity sweep (I am going crazy)posted in Tutorials by Users
This is a pretty EA to build, do you have any start? Once per bar->Was the last candle high/low higher/lower than candle 1 (daily) high/low?->if yes, buy/sell
-
RE: Trailing stop issuesposted in Questions & Answers
Seems like you could do this with a check profit (unrealized) block and when that condition is true, you enable the trailing stop.
-
RE: Trailing stop issuesposted in Questions & Answers
The issue here is that your offset is looking for a price value and you are giving it a profit value: It's expecting a value like, $1.53, and you're sending $250 or something like that.
When do you want to trailing stop to start? I typically set mine up to be at a % of the stop loss. So, if I'm risking 1% of my account per trade, my SL represents that 1%, and I want my trailing stop to kick in when I'm 150% away from my stop loss, or 1.5 risk to reward.
-
RE: % of TP and SLposted in Questions & Answers
In the trailing stop settings, you need to have the offset set to 90% of the opposite stop.
