Try using long datatype

Best posts made by roar
-
My trash binposted in Bug Reports
I played with objects today, and made some EA using regression channels.
Its a huge mess. But there is something I like about this monster.
Its not optimized in any way, but I thought why not share this, maybe it inspires someone.
The project is so huge the browser builder doesn't seem to load it, so here's the .mq5 (compile it in your metaeditor)
This works (least horribly) on EURUSD, M30. You can use open price -only testing, I designed that way.
0_1524336136732_LINEAR2.mq5
0_1524347440090_LINEAR2.1.mq5Part 2: Here's a simple project that "remembers" recent highs and lows, using slow macd. Next I'm going to implement the regression channel to this
https://fxdreema.com/shared/BhZLMirre -
RE: struct member undefinedposted in Questions & Answers
@bluemoon This bug happens when you insert a variable to some field (so it turns blue), but the builder doesn't actually register it as a variable (for some reason, maybe there was already some value in the field).
Solution: as Philipps said, go to your metaeditor and find the corresponding block ID -> then return to the builder and re-create that block.
-
RE: Issue backtesting two pairs on MT5posted in Bug Reports
@ambrogio tested in netting mode, and it works ok.. Maybe it is confusing the modes, calculating average price of all those buys. I dont use that block myself
-
RE: BE lets me go crazy - i really need help after watching every tutorial and x hoursposted in Questions & Answers
@tom-5 If you turn off block 85, everything below it will also be off, because the signal never reaches the below blocks.
Your problem is easier solved with a simple variable, look them up

-
RE: Profitable test results on Falcon and Condor, and forward testing looking goodposted in General Discussions
@seb-0 the "TP or SL trigger choice problem" might not be the reason here, as there is supposedly always min 20 pips difference between those levels.
I am very interested in this, but purely from the point of figuring out where the tester goes wrong, in what detail does the devil hide...
@Julianrob your mt5 backtest shows much larger "largest loss trade" while the mt4 backtest seems to have a fixed SL, largest being the same as average. -55 vs -6. So there is some different trading logic going on.
-
RE: Indicator rounding and cross (x> and x<) logicposted in Bug Reports
@sidmcfarland I think you are on to something... I even modified the example so that there is no cross operator, just two separate conditions with candle ID 1 and 2 (= how the cross theoritically works).
Even then I dont get a line on one particular cross. -
RE: Help needed in modifying values in a sequenceposted in Questions & Answers
@rafaels919 Hi!
That's right, my approach is to convert the sequence string to an int array (because you can't use a string in any calculation). This converting is done in the "on Init" tab.
- What is the Variable "seq[]" used for?
This is a special kind of variable: an array. Arrays dont store just one value, but multiple values - like a list, or a table.
In MQL, array indexing starts from 0, so the first value of your sequence is seq[0] = 1,
if the original sequence string was "1,2,3,4,5,6".
Last value would be seq[5].
^ This part is for resetting the sequence, in case we go to a 7th loss (and the array doesn't have a value for that). "seqLen" is the size of the array, and because arrays start from 0, the actual last index in the array is seqLen - 1.I admit, this is very confusing setup, lol. But you don't necessarily need to know every detail, just know that you can modify the loses variable to set the sequence to whatever value you like.
If you want revert to 2nd sequence value, modify variable loses to 1.
For 3rd sequence value, modify variable loses to 2. -
RE: When to stop OnInit()posted in Bug Reports
@fxDreema I understand, both of your points.
I have just seen some "EA builders" offered by brokers, and they are always miles, light years behind fxdreema. This is the iPhone of EA industry lol
-
RE: Betting System: Fibonacci first lotsize base on balance, is it possible?posted in Questions & Answers
@tom-5 To use 0.1 lots for every 1000$ in balance, put this string into the initial volume field:
AccountBalance()/1000*0.1
-
RE: Blocks with intermittent problems.posted in Bug Reports
I use the loop block every day, no problem whatsoever. Please make some kind of example project
-
RE: How to validate and reset conditions?posted in Questions & Answers
Here's an example how to create such "time windows":
https://fxdreema.com/shared/Oyixkzrod- Create a variable that increases a count on every new bar (1,2,3,4,5....)
- When 1st condition passes, reset that count back to 0
- Now 2nd condition must pass before that condition gets bigger than 6 again
-
Candle Close selection rounds to nearest integerposted in Bug Reports
When using the Candle price selection in a different pair than the current chart, the result is rounded to nearest integer. I hope this gets fixed before too many users lose their mind troubleshooting their multi-currency projects (like I did lol).
Tested on mql4.
https://fxdreema.com/shared/wNcSJRJkd

-
RE: candle idposted in Questions & Answers
how does the candle id work
Current candle is candle ID 0
Last completed candle is ID 12 candles back = candle id 2
4 candles back = candle id 42 candles into the future = candle id -2
4 candles id into the future = candle id -4 -
RE: about block numberposted in Questions & Answers
Block IDs set the procedure when one block triggers multiple blocks.
This setup will have an SL:

This setup will NOT have any SL:

However, I don't bother fixing the block IDs in my projects, as I constantly copy and rearrange multiple blocks. A somewhat clearer way is to take the "Loop (pass n times)" block and set the looping cycle 1. This block will now set the procedure regardless of the block IDs.
This setup will have SL:

-
RE: Day of month filterposted in Questions & Answers
@nmbruno mql4 documentation is often helpful

https://docs.mql4.com/dateandtime/monthPut Month() into a variable once a week (once a bar, period 1W) and when Month() is != than that variable, new month must have been started
-
RE: Use the MACD Histogramposted in Questions & Answers
To clarify:
- "main line" is the MACD value (which is difference between 2 emas of price)
- "signal line" is 9-period MA of the MACD
- "histogram" is the difference between main line and signal line
