You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Since when is a period a Double type?
That's what I'm saying, string+int is a mistake
But if you do it the way I wrote above, there will be no error.
That's what I'm saying: string+int is an error.
But if you do it the way I wrote above, there will be no error.
IntegerToString? Nope, haven't heard ;)
IntegerToString? Nope, haven't heard ;)
hi all
I am new to programming, but trying to learn)
I have a little problem with closing the order according to the indicator readings
i should tell straight away about opening and closing conditions: i open a position following the indicator readings and close it following the indicator readings but in the opposite direction without any stops and profit
if(r > 50 && p > m) //conditions for opening of a Buy order
{
ticketB = OrderSend(Symbol(),OP_BUY,0.1,Ask,5,0,0,",111,0,Green); //open Buy order
}
am I writing the order close condition correctly?
if(r < 50 && p < m) --- this is a Sell condition and a Close condition
{
OrderClose(ticketB,0.1,Bid,5,Red);
}
and prints possible use of uninitialized variable 'ticketB' and return value of 'OrderClose' should be checked
Can you guys tell me where I wrote it wrong?
hello all
I am new to programming, but trying to learn)
I have a little problem with closing the order according to the indicator readings
i should tell straight away about opening and closing conditions: i open a position following the indicator readings and close it following the indicator readings but in the opposite direction without any stops and profit
if(r > 50 && p > m) //conditions for opening of a Buy order
{
ticketB = OrderSend(Symbol(),OP_BUY,0.1,Ask,5,0,0,",111,0,Green); //open Buy order
}
am I writing the order close condition correctly?
if(r < 50 && p < m) --- this is a Sell condition and a Close condition
{
OrderClose(ticketB,0.1,Bid,5,Red);
}
and prints possible use of uninitialized variable 'ticketB' and return value of 'OrderClose' should be checked
Could you guys tell me where I wrote it wrong?
The ticketB variable isn't initialized, i.e. its type isn't known. In this case it is Int
The second error is that we have to check the result of closing the order for errors. Search "error handling function" in the forum
the ticketB variable is not initialised, i.e. the type is not known. In this case it is Int.
The second error is about checking the result of order closing for errors. Search "error handling function" in the forum
I can't quite figure out the logic or am dumbfounded), but how do I do it? At first I tried to do it using OrderSelect but it was wrong)
I need some info on this.
is it GetLastError? I can't understand the logic or I'm a bit dumb) but how to set it? at first I tried to do everything with OrderSelect, but it's not the same)
I need some info on this.
Yes.
Look through the codebase - plenty of examples of implementation.
Where is the logic? You set the maximum allowed lot for the first order and then increase it for each subsequent order. Don't you think this is, to put it mildly, not very sensible?
Further, you decrease the lot of the first order in the loop using some totally incomprehensible method, while the lots of the other orders that were "calculated" before remain unchanged, and these values do not go beyond the limits of this function. So, what do they do then?
Not to mention that the increment loop can't be a real number, it has to be a counter, an integer. But you set the lot value as a counter and subtract one from it each iteration. This is a major mistake, a very serious one.
Clarify the logic in your mind first and then try to implement it into your code.
What do you think about it?
I will say the same. You're not good at logic. What is the problem to immediately calculate the initial lot, based on available funds and the value of the risk (I think it was written about 3%)? Why do you have to do everything in one place?
Take the value of the free margin, multiply by the risk, divide by 100 and the value of the margin for 1 lot - here is the simplest formula for calculating the lot with a specified percentage of the free margin. Also, you need to take into account the step of lot change and prevent exceeding the min/max lot size permitted by brokerage companies: