"I change it now but it doesn't repair the problem becouse in my code was
smaller not higher value so there should be action faster...."
What sort of "action faster" are you hoping, expecting, to experience? You have to define this (fortunately or unfortunately), then only you can test/verify, hence improve/work on this "action faster"thingy of yours.
"I change it now but it doesn't repair the problem becouse in my code was
smaller not higher value so there should be action faster...."
What sort of "action faster" are you hoping, expecting, to experience? You have to define this (fortunately or unfortunately), then only you can test/verify, hence improve/work on this "action faster"thingy of yours.
for ( i = OrdersTotal () - 1 ; i >= 0 ; i -- )
if (OrderSelect(i, SELECT_BY_POS)
&& OrderSymbol () == Symbol()
&& OrderType () == OP_SELL
&& diference <= OrderProfit () )
{
So what do you suggesst? I had thinking that if I am using double diference = 20 * Point than it is 20 pips so this is easier/faster to break this by the course than break 200 pips...
Do you say that it should be written some how in currency ?
So what do you suggesst? I had thinking that if I am using double diference = 20 * Point than it is 20 pips so this is easier/faster to break this by the course than break 200 pips...
Do you say that it should be written some how in currency ?
EA's should adjust for 4/5 digit brokers. Your 20 * Point is NOT 20 pips on a 5 digit broker. (20 * pips2dbl is always 20 pips)
double PointValuePerLot(string pair="") {
/* Value in account currency of a Point of Symbol.
* In tester I had a sale: open=1.35883 close=1.35736 (0.00147)
* gain$=97.32/6.62 lots/147 points=$0.10/point or $1.00/pip.
* IBFX demo/mini EURUSD TICKVALUE=0.1 MAXLOT=50 LOTSIZE=10,000
* IBFX demo/standard EURUSD TICKVALUE=1.0 MAXLOT=50 LOTSIZE=100,000
* $1.00/point or $10.00/pip.
*
* https://www.mql5.com/en/forum/127584 CB: MODE_TICKSIZE will usually return the
* same value as MODE_POINT (or Point for the current symbol), however, an
* example of where to use MODE_TICKSIZE would be as part of a ratio with
* MODE_TICKVALUE when performing money management calculations which need
* to take account of the pair and the account currency. The reason I use
* this ratio is that although TV and TS may constantly be returned as
* something like 7.00 and 0.00001 respectively, I've seen this
* (intermittently) change to 14.00 and 0.00002 respectively (just example
* tick values to illustrate).
* https://www.mql5.com/en/forum/135345 zzuegg reports for non-currency DE30:
* MarketInfo(Symbol(),MODE_TICKSIZE) returns 0.5
* MarketInfo(Symbol(),MODE_DIGITS) return 1
* Point = 0.1
* Prices to open must be a multiple of ticksize */if (pair == "") pair = Symbol();
return( MarketInfo(pair, MODE_TICKVALUE)
/ MarketInfo(pair, MODE_TICKSIZE) ); // Not Point.
}
:
double perLotPerPoint = PointValuePerLot(symbolOrder),
OrderPips = OrderProfit() / OrderLots() / perLotPerPoint;
:
if( diference <= OrderPips )
Or just compare prices
&& Bid > OrderOpenPrice()
&& Bid < OrderOpenPrice() + diference // Buy between 0 and 'diference' pips
So what do you suggesst? I had thinking that if I am using double diference = 20 * Point than it is 20 pips so this is easier/faster to break this by the course than break 200 pips...
Do you say that it should be written some how in currency ?
Do you know how?
I saw the other helper assistance who stays ard here, WHoredr, you can't miss him, whose piece of code which returns proper TickValue of the Symbol() you load.
The code is GOOD, if not, FABULOUSLY ELEGANT by anyone's standard. Short, sweet and cooking, just the way anyone will be please. Very easy to use.
Me - I have been doing this the other way ever since MQL was born, converting currency directly into pips, instead of your likings and logic.
I don't want this to get this complicated for you. So bottomline, go seek WHOredr on this matter. He is a good-hearted, inteliigent man, I'm sure.
Me - I have been doing this the other way ever since MQL was born, converting currency directly into pips, instead of your likings and logic.
I don't want this to get this complicated for you. So bottomline, go seek WHOredr on this matter. He is a good-hearted, inteliigent man, I'm sure.
*
*
*
I'm going creazy:)
Your language is complicated for me so I have hope that I will understand everything.... Like in the history with beer and mug....... :)
You does seem to be going in circles, but there is no reason to get crazy. Maybe this a better approach:
Say, the other day some fortune-teller tells you your lucky number. Let say that number is 33.333. (a highly precise fortune-teller, I guess - uses double) .
So nowadays, people are smarter, they put that in MQL, instead of using lucky charms to hang around their necks, like in the old ways.
double MyLuckyNumber = 33.333333; <------ Let say that number is 33.333. (a highly precise fortune-teller, I guess - uses double)
if(OrderProfit()>= MyLuckyNumber) { close .....} <------ You decide to use this number to close trades, take profit.
You decide to use this number to close trades, take profit. If anything exceeds this, bad things can happen. With this, you trade 1 standard lot.
Instantly like magic, your 1 lot gains slightly more than 1 PIP. Your reaction - how much profit? Then you see 33.33, or rather $33.33 USD (say you account currency in USD). Close trade.
After a few days of doing this, you begin to realise, you're not making that much by closing on just slightly more than 1 PIP on every trade, because of that 33.3333.
Problem is too, you cannot make do without this Lucky Number. So, you decide to close when 33.3333 PIPS exceed....that way, you're going make more.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Thanks diostar.
I change it now but it doesn't repair the problem becouse in my code was smaller not higher value so there should be action faster....
"I change it now but it doesn't repair the problem becouse in my code was smaller not higher value so there should be action faster...."
What sort of "action faster" are you hoping, expecting, to experience? You have to define this (fortunately or unfortunately), then only you can test/verify, hence improve/work on this "action faster" thingy of yours.
"I change it now but it doesn't repair the problem becouse in my code was smaller not higher value so there should be action faster...."
What sort of "action faster" are you hoping, expecting, to experience? You have to define this (fortunately or unfortunately), then only you can test/verify, hence improve/work on this "action faster" thingy of yours.
Now it's almost in every tick true.
So what do you suggesst? I had thinking that if I am using double diference = 20 * Point than it is 20 pips so this is easier/faster to break this by the course than break 200 pips...
Do you say that it should be written some how in currency ?
Do you know how?
So what do you suggesst? I had thinking that if I am using double diference = 20 * Point than it is 20 pips so this is easier/faster to break this by the course than break 200 pips...
Do you say that it should be written some how in currency ?
Now it's almost in every tick true.
So what do you suggesst? I had thinking that if I am using double diference = 20 * Point than it is 20 pips so this is easier/faster to break this by the course than break 200 pips...
Do you say that it should be written some how in currency ?
Do you know how?
I saw the other helper assistance who stays ard here, WHoredr, you can't miss him, whose piece of code which returns proper TickValue of the Symbol() you load.
The code is GOOD, if not, FABULOUSLY ELEGANT by anyone's standard. Short, sweet and cooking, just the way anyone will be please. Very easy to use.
Me - I have been doing this the other way ever since MQL was born, converting currency directly into pips, instead of your likings and logic.
I don't want this to get this complicated for you. So bottomline, go seek WHOredr on this matter. He is a good-hearted, inteliigent man, I'm sure.
diostar
Me - I have been doing this the other way ever since MQL was born, converting currency directly into pips, instead of your likings and logic.
I don't want this to get this complicated for you. So bottomline, go seek WHOredr on this matter. He is a good-hearted, inteliigent man, I'm sure.
*
*
*
I'm going creazy:)
Your language is complicated for me so I have hope that I will understand everything.... Like in the history with beer and mug....... :)
WHRoeder
My broker is 4 digits.
double diference = 200 * Point;
But there is on every tick still true...
I see that now it's like diference is 0pips.
I haven't reach 200 pips.
Everything else is going good couse I've give sleep(2000) behind every action too see how it works step by step.
It,s like EA
didn't read diference.
How to use?
I try like that:
#define DOLLARS10 10.00Bid < OrderOpenPrice() + DOLLARS10 )What does price + dollars mean? NOTHING
REREAD my post #2
#define DOLLARS10 10.00 But still the same - DOLLARS10 is 0How do you come up with what?
But there is on every tick still true...
So start printing values and figure out WHY
&& OrderSymbol () == Symbol() && OrderType () == OP_BUY && Bid > OrderOpenPrice() && Bid < OrderOpenPrice() + DOLLARS10 ){ Print("Found@",i,OrderTicket(), " ",Symbol()," type(", OrderType(), ") OP(",OrderOpenPrice(),") < "Bid(",Bid,") < OP+$10(", OrderOpenPrice()+DOLLARS10,")");THINK
diostar
Me - I have been doing this the other way ever since MQL was born, converting currency directly into pips, instead of your likings and logic.
I don't want this to get this complicated for you. So bottomline, go seek WHOredr on this matter. He is a good-hearted, inteliigent man, I'm sure.
*
*
*
I'm going creazy:)
Your language is complicated for me so I have hope that I will understand everything.... Like in the history with beer and mug....... :)
You does seem to be going in circles, but there is no reason to get crazy. Maybe this a better approach:
Say, the other day some fortune-teller tells you your lucky number. Let say that number is 33.333. (a highly precise fortune-teller, I guess - uses double) .
So nowadays, people are smarter, they put that in MQL, instead of using lucky charms to hang around their necks, like in the old ways.
You decide to use this number to close trades, take profit. If anything exceeds this, bad things can happen. With this, you trade 1 standard lot.
Instantly like magic, your 1 lot gains slightly more than 1 PIP. Your reaction - how much profit? Then you see 33.33, or rather $33.33 USD (say you account currency in USD). Close trade.
After a few days of doing this, you begin to realise, you're not making that much by closing on just slightly more than 1 PIP on every trade, because of that 33.3333.
Problem is too, you cannot make do without this Lucky Number. So, you decide to close when 33.3333 PIPS exceed....that way, you're going make more.
See the difference??