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
As you suggested, the compiler swears.
Ticket=OrderSend(NULL,OP_BUY,Lot,Ask,slippage,0,0,NULL,magic,0,Blue);
if(!Ticket>0)Print(GetLastError());
else
{
if(OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES)==true)
if((OrderMagicNumber()==magic) && (OrderSymbol()==Symbol()))
{
TP=NormalizeDouble(Bid+TakeProfit*Point,Digits);
bool modify=OrderModify(OrderTicket(),OrderOpenPrice(),TP,0,0);
return;
}
}
Doesn't work.
As you suggested, the compiler swears.
Ticket=OrderSend(NULL,OP_BUY,Lot,Ask,slippage,0,0,NULL,magic,0,Blue);
if(!Ticket>0)Print(GetLastError());
else
{
if(OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES)==true)
if((OrderMagicNumber()==magic) && (OrderSymbol()==Symbol()))
{
TP=NormalizeDouble(Bid+TakeProfit*Point,Digits);
bool modify=OrderModify(OrderTicket(),OrderOpenPrice(),TP,0,0);
return;
}
}
It doesn't work.
Here is your code:
if(! Ticket>0)Print(GetLastError()) --- Ticket is an integer number, i.e. "2354865". Now a question: can an integer not be ( !2354865) An integer can either be greater than "> 0" or less than "< 0" . This bool value can be false/true ( ! )
Further, this construction:if(OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES)==true) --- it enumerates parameters by ticket, and if you view a concrete ticket, it makes no sense to check its magic number or symbol, i.e. it is obviously unnecessary:if((OrderMagicNumber()==magic) && (OrderSymbol()==Symbol()))
And lastly, such constructs are better bracketed to explicitly specify the order of mathematical tasks:NormalizeDouble(Bid+( TakeProfit*Point),Digits);
And lastly, it is better to bracket such constructions to explicitly specify the order of matrix tasks:NormalizeDouble(Bid+( TakeProfit*Point),Digits);No, you can do it without brackets. But when the sum has to be multiplied, then brackets are required.
can take the value of 0 bar open time with period D1, + add the number of seconds,
in the condition to compare the current time with the obtained time in the first line
in a pending order it is possible to put a number of seconds, time of life of the order.
Help with the code, the advisor goes through all the bars, how to make it go through the last 200 bars! Thanks
for (i=1; i<k; i++)
Provider_Signal
Forum on trading, automated trading systems and testing trading strategies
Questions from Beginners
Provider_Signal, 2016.11.09 18:38
How to close all orders in EA on Friday night ? So as not to leave it for the weekend.
Found function DayOfWeek().
I can write a check
{
//
}
But what kind of check should we write for time. For example, what if it was 22:00 ?
Provider_Signal
if (Hour()==St_Hour)
Help with the code, the advisor goes through all the bars, how to make it go through the last 200 bars! Thanks
for (i=1; i<k; i++)
Hello, help.
If no buffer is filled on three bars, I fill the buffer.
int BarCount=3;
BER=true;
for(int il=1;il<=BarCount;il++)
{
if(BufferPointUp[il]!= EMPTY_VALUE){BER=false;break;}
}
if(BER) BufferPointUp[i]=high[i];
It fills on all bars, indiscriminately.
But everything is correct if I do this.
How to dothis check in a loop ?
if (Hour()==St_Hour)