You can loop through all the pending orders and skip the first XXX and then delete.

Posts made by cmuphyfx
-
RE: Deleting pending orders with time filterposted in Questions & Answers
-
RE: every tick based on real ticks - MT5, huge variance in resultsposted in Questions & Answers
@OntradingX is correct about brokers. A patricular EA of mine could be classified as a scalping strategy and works very well on ICMarkets data, but when I take the EA and backtest on FTMO data feeds, it falls apart. My solution to this is to use a trade copier so I am not crushed by the difference in market conditions.
-
RE: every tick based on real ticks - MT5, huge variance in resultsposted in Questions & Answers
@martymoon120 MT5 has a strategy tester where you can optimize parameters. Sounds like exactly what you need to do. Seems like you just need to optimize on how many pips to place the SL and where to start a trailing stop. I see 4 variables there that need to be optimized on... RR, trailing stop start, size, step. You can easily do this in MT5
-
RE: every tick based on real ticks - MT5, huge variance in resultsposted in Questions & Answers
I use the strategy tester in MT5 for all my data - it gets the data from the broker where I also run the EAs. Data is very important - I've found optimizing from broker to broker is VERY different and should be avoided. If you test and tune on a specific brokers data, you should also run the EA there.
-
RE: every tick based on real ticks - MT5, huge variance in resultsposted in Questions & Answers
I typically use 1M OHLC data to find rough parameters, and then use tick data for final optimization with trailing stops.
-
RE: every tick based on real ticks - MT5, huge variance in resultsposted in Questions & Answers
@martymoon120 There have been a number of threads on this, one that I recently found which was very helpful.
Essentially, what's happening is the testing software makes your 1M OHLC backtest look a LOT better than real results because there is a flaw in the software that interpolates what happens between those 4 values (OHLC). So, in most cases when you have an open order the testing software 'gives' you a perfect entry, right at your asking price, it also gives you a perfect exit, even if it doesn't have the data near your TP or SL.
The best way to explain this is like this: If have have an M15 candle, that is 15 pips in total size (high to low). There are 4 values associated with those 15 pips, OHLC. Let say you placed a trade at the open of that candle and had your SL 5 pips from the entry and a TP was also 5 pips from the entry. Using OHLC data the backtesting software will likely tell you that your TP was hit and not your SL, even though the SW does not have the data to definitively tell you. It's just randomly generating data inside that 15M candle between the OHLC.
Some parameters can be found using 1M OHLC, but anything that dictates TP or SL (Trailing stops) should be optimized and testing on Tick data.
-
RE: Help with Failed Executed Orderposted in Questions & Answers
you could also do a count of open positions before you place anew trade and after. if the value did not increase by 1 then the volume for the next trade should not increase
-
RE: Help with Failed Executed Orderposted in Questions & Answers
Try looping through open positions to get the last successfully placed trad, in the loop grab the volume size and then use whatever formula agaist that valune to increase the size for the next position
-
RE: problem with increasing positionposted in Questions & Answers
You should be able to view the volume size of the last closed trade. Determine volume and if it was a win or loss. If loss set new volume variable with 4X the last trades volume. If winner, set volume to .1.
-
RE: Backtesting, lets talk about it!posted in General Discussions
@roar When you run an EA live, do you then replace all trading actions (open, close) from once per bar to per tick (via pass block?)
-
RE: Backtesting, lets talk about it!posted in General Discussions
Forgot to add details on the solution.
- once per bar loop through open trades (my EA only has 1 trade open at a time)
- Get the SL size in pips and multiply it by a factor, for example, if you want a 2RR trade you multiply the SL by 2
- Check if we're a buy or sell order
- calculate the TP price by adding or subtracting the pips you just calculated to the open price
- Check close conditions for SL - Was the low of the last candle lower than our SL price? Was the high of the last candle higher than our SL price - if yes, close
- Same as above but for a TP price.
-
RE: Backtesting, lets talk about it!posted in General Discussions
This thread has been incredibly helpful - thank you to all who contributed. I too have run into this problem where on 1M OHLC I have an incredible EA and then live it drastically underperforms. The challenge here is that in order to follow 'good' backtesting procedures we need to use 2+ years of data, and 1-2 years of out of sample data for verification. As we all know those tests take hours and hours to run every tick.
Here's a quick solution, which I think embodies the essence of @roar's comments for a once-per-bar TP and SL. The challenge here is how to optimize trailing stops - I don't think you can. I suspect we'll have to use every tick data for that?

-
RE: trailing stop/trailing profitposted in Questions & Answers
I'm not familiar with those settings you have - I have not ever used % of profit. If it seems to be working for you, and you've watched it execute then good!
-
RE: trailing stop/trailing profitposted in Questions & Answers
You're going to have to use a few variables for that. I suggest that when the trade is placed, you save the stop loss size, in pips as a variable. You'll need this because you'll need to know what 1% is as you continue to trail your stop. Once you know the stop loss, in pips you know the size, so you can use a simple Trailing Stop block, and have the offset begin at 300% of the initial stop loss size, and for size you can use the variable from earlier.
For you, the trailing start would simply be 300%
On Trade I capture the SL size. Then, I have a Trailing Stop that uses that value


-
RE: OpenCLposted in Questions & Answers
@sktsec Found out it was the build version. Build 4040 works well, the latest demo build 4057 has a terribly slow strategy tester.
-
RE: OpenCLposted in Questions & Answers
Are you also experiencing slow MT5 performance? I can't seem to find the cause. I hooked up my laptops to the local network and even they are crawling, making me think it's not my PC and must be a MT5 issue. Google hasn't been useful here...
-
RE: OpenCLposted in Questions & Answers
My MT5 optimization has been incredibly slow the last few days. Optimizing a single parameter now takes 5-6 times as long as it did a week ago with 0 code changes. Unsure if there was something that happened in the latest MT5 build or if my PC is crashing... Was just looking for a potential way to increase performance, as I have a lot of GPUs laying around.
-
RE: OpenCLposted in Questions & Answers
@roar Any chance you've experimented with OpenCL and GPUs to increase optimization?
-
RE: Project randomly wont compile - PERIOD_CURRENT Undeclared?posted in Questions & Answers
Do we have any idea who can help us (admin side) clear this up? Very annoying to have to download and build myself every time I make a change.
