@cerrase Ok. Firstly, about opening multiple trades per 1 bar - the code runs on every tick, so we should put a "once per bar" at the top of our logic, if we want max 1 trade per bar.
Posts made by roar
-
RE: After profitable position pass n positionposted in Questions & Answers
-
RE: After profitable position pass n positionposted in Questions & Answers
@cerrase I can look into it. Could you please share a copy of the current project, and try to simplify the problem as much as you can.
-
RE: Here, take this profitable eaposted in Tutorials by Users
@bentyekiff
Biggest problem is the netting system. When this bot "buys", it actually closes sell trades if there is a running sell trade. So, converting to mt4, every time there is a buy/sell operation, must check first if there is an opposite trade running, and if true, then close (partially) that opposite trade.https://fxdreema.com/shared/pTIbLpWob
I can't get the builder open, probably some problem in the fxdreema server, but I think there was also some timeframe modifications - I don't know how mt4 applies multi-timeframe. -
RE: Hide the visual modeposted in Questions & Answers
@wessel Actually there is many ways to protect your work - you can set a password condition, date limit, and use the "if testing" block.
I never found the option to only hide visual mode, though. I think you have to block backtesting altogether. -
RE: MACD divergenceposted in Questions & Answers
@josh01
Its the difference between MACD signal line and the main line. If that is what you mean by divergence -
RE: Scalper Expert adviceposted in General Discussions
@vnpython-0
It depends on your trading costs. If the costs (spread, commission, swap) are higher than 20% of your average profit, it means you have to get roughly 70% winning trades, on 1:1 SL and TP. No one has that big predictive power.
To decrease the % of trading cost of average profit, you need to trade the most volatile periods (of the trading day).
Just make an ea and analyze the trading costs in the excel report. If the % is too big, increase your average TP and trade less frequently. -
RE: Here, take this profitable eaposted in Tutorials by Users
@karoshi
There is no MT4 version at the moment. This EA utilizes multiple timeframes and the netting method (no buys and sells at same time). Converting to MT4 is possible but takes some work.Backtested this EA again today, this time with a different broker. Tbh didn't quite expect such a good result, lol


-
RE: do not trade for x period of time?posted in Questions & Answers
My usual approach would be to create a variable that counts +1 on every new bar, but I actually think its more efficient to use this checking process before opening trades:

https://fxdreema.com/shared/7CPsdda4d -
RE: EA FOR ATRposted in Questions & Answers
@henpo1975
With custom indicators, the problem can be anything in the inner mechanics... Try different mode-settings, and also try using candle ID 1, instead of ID 0 which is the default.

-
RE: EA FOR ATRposted in Questions & Answers
@HENPO1975
Orange = TRUE
Yellow = FALSEThe logic is good in this case. You will have only 1 running trade at a time.
If you delete the "no trade", the bot can potentially create a new trade on each tick (because the whole code executes on each tick) -
RE: How to do a trailing stop and a stop loss for fractals?posted in Questions & Answers
Use right click to put a variable to the stop-loss field.
Stop-loss at last fractal:

-
RE: Need help backtestingposted in Questions & Answers
If you are new to forex, why bother learning the old MT4 when you can jump directly to MT5?
I know, there is still a great debate over which version is better overall, but it is a fact that backtesting is way better on MT5. -
RE: How to do a trailing stop and a stop loss for fractals?posted in Questions & Answers
@cristobaljosemt5
Oh, of course - these are the needed variables:

-
RE: How to do a trailing stop and a stop loss for fractals?posted in Questions & Answers
@cristobaljosemt5
The fractal differs from the usual indicators in many ways:- Fractal is never on candle ID 0 or ID 1, because it needs 2 candles to complete. So the first candle to look for a fractal is ID 2.
- When a candle doesn't have a fractal, indicator value is 0 (I think).
- Up fractal value is candle high, down fractal value is candle low.
We need to track the fractals with variables:
https://fxdreema.com/shared/BedFyvXUdOnce we have the fractal stored in a variable, setting the stop loss level shoud be simple.
-
RE: Manually Debug??posted in Questions & Answers
@headcom Do you know the comment-block in fxdreema? It can be used to track variables during visual test
-
RE: Please teach me why the Close Trades didn't workposted in Questions & Answers
@pei
Well, you use "once per bar", so the EA only checks the candle open. ID 1 means history (first history bar), you can't decide to close your trades at a history time, you see. -
RE: how to make my betting martingale/paroli settings change when my account grows? is it possible?posted in Questions & Answers
Simply:
- Store your initial balance to a variable, initial_balance

- Before buying, check how much the balance has grown (or fallen) from the start:

- Then we can update our lot value by that ratio, (current equity / initial balance) times our standard lot amount (0.01). AccountEquity() is a standard mql4 formula that returns equity
- Then we can just insert the variable lot to "buy now":

- Store your initial balance to a variable, initial_balance




