@swissi this is just a wild guess, but the warning maybe considers the difference between double and int data types...
Try changing your double variable to int, maybe it does the trick

Posts made by roar
-
RE: Error message when compilingposted in Questions & Answers
-
RE: Error message when compilingposted in Questions & Answers
@swissi
"possible loss of data due to type conversion" is not an error, just a warning. -
RE: How to set/check a time stamp or candle IDposted in Questions & Answers
@ikarus_ said
Just one thing from the moment the candle close was above the tenkan sen Line it should always close above.
So the condition is "each of last 30 candles are above tenkan-sen"?
Then use the loop to try and find a candle that doesnt meet the condition -> now set your tracking variable to FALSE. The logic flow continues to next stage only if the variable keeps its TRUE value throughout the whole loop. Hope you get what I mean...Also the Loop conditions have to always be on Tick right?
Not necessary.. As long as you can activate the loop (using OnTick, OnTrade, OnInit, whatever), it will surely do its thing.
-
RE: How to set/check a time stamp or candle IDposted in Questions & Answers
@ikarus_ all right, here is an example of two loops. The example goal is to first find some candle above tenkan-sen line in the last 30 candles, and then find some candle below moving average in the last 30 candles.
There is probably something weird-looking here, just ask
https://fxdreema.com/shared/iiAq2ApF


-
RE: How to set/check a time stamp or candle IDposted in Questions & Answers
@ikarus_ you need a loop, every programmer's best friend.
And to operate this loop, you have to use variables.
Are you familiar with variables? -
RE: work in one per tickposted in Questions & Answers
@khalids222 so the EA will buy every new tick, as long as current candle is bullish?
Otherwise my example should be pretty close -
RE: EA dumpposted in Tutorials by Users
@kizerage212 hedge accounts will not close the trades. The system relies on the netting method - new buys close old sells and vice versa. There is no other exit method specified.
-
RE: work in one per tickposted in Questions & Answers
@khalids222 I dont understand what you mean by stopping or reversing from buy to sell, how should the EA know the turning point...
-
RE: work in one per tickposted in Questions & Answers
@khalids222 the system does stop opening when price comes back i.e. it only trades when the candle makes a new extreme
-
RE: work in one per tickposted in Questions & Answers
@khalids222 I think something like this is close to what you want:
https://fxdreema.com/shared/zbecete9eThere's going to be problems, though.
- Brokers have a limit of total open orders, usually 150-200
- Most of price movement is consolidation in place, meaning you will have lots of both buys and sells in loss.
I do get a lot of requests, and I have to postpone and then I forget some of them...
-
RE: Weighted average price of bucket of tradesposted in Questions & Answers
@bhovens not a very simple one, but I got a method:
https://fxdreema.com/shared/ZlIOMdTvc -
RE: Need help with Breakeven and Trailing Stop at a certain Percentage of Profitposted in Questions & Answers
@danzadrummer weird. Does the trailing stop look like this

-
RE: EA dumpposted in Tutorials by Users
@ramisignals said in EA dump:
This one with no SL it will margin the account
As I said, its for a netting type account. No need for SL (or TP), as long as your lot amounts are sensible.
https://hercules.finance/faq/what-is-netting-system-on-mt5-trading-platform-how-does-it-work/ -
RE: EA dumpposted in Tutorials by Users
Here's the project: https://fxdreema.com/shared/YtCrSX5qb
This only works on mt5 with netting accounting.
I will not convert this to mt4, or even mt5 with hedging accounting, because:- I'm feeling lazy
- I really recommend you to use mt5 with netting. Very often someone asks here in forum to calculate average entry, or close buys and sells together. Netting account does this automatically -> your EA developing is much more simple, multiplying your chances of success.
I'll continue to add some filters or otherwise fine-tune this system, may inform here or not.
-
EA dumpposted in Tutorials by Users
A simple scalping EA idea in case anyone is interested.
Lets compare the difference between 13-ATR and 13-Standard Deviation on EURUSD M30 chart.
When STD is significantly below ATR, market is making large candles but not moving anywhere.
Here's our opportunity to switch to 5-minute chart and buy/sell using fast RSI.


Backtest from 2007 yielded surprisingly good result for such a basic system.

-
RE: Need help with Breakeven and Trailing Stop at a certain Percentage of Profitposted in Questions & Answers
@biztet I did a quick backtest, seems to work - go ahead
-
RE: Need help with Breakeven and Trailing Stop at a certain Percentage of Profitposted in Questions & Answers
@l-andorrĂ @biztet lol

@danzadrummer We can use mql4 function AccountBalance() in the trailing stop settings, maybe that does the trick:
https://fxdreema.com/shared/0R74W0tMc -
RE: Description or constant.posted in Questions & Answers
You can insert constants to drop-down menus just like plain fields, by right-clicking:

However, the drop-downs are usually some specific data type, so you have to do some googling
https://www.google.com/search?q=mql4+color+datatype&oq=mql4+color+datatype&aqs=chrome..69i57j33l3.9319j0j7&sourceid=chrome&ie=UTF-8
->
https://docs.mql4.com/basis/types/integer/color
->
https://docs.mql4.com/constants/objectconstants/webcolors
->
The datatype is integer, and the colors have their own codes, clrRed for example.

-
RE: example: For each tradeposted in Tutorials by Users
@bhovens said in example: For each trade:
close the first and last trade, when profit is 5 for both first and last trade
What do you mean, exactly?
First trade profit + last trade profit >= 5 ?Currently there is no AND logic, the EA just closes first trade OR last trade whenever one of them is $5 in profit.
If you do want this AND logic, here's a method to do it with two variables; firstprofit and lastprofit:
https://fxdreema.com/shared/yoGXk7TYd