# [WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1079

The idea is this: if the candle is above a certain value, then prohibit further trading.

//---------- start()

{.......

if(CalculateCurrentOrders(Symbol())==0 && CheckVolume()==1) CheckForOpen(); //--------open order if (no order is open) AND (candlestick is not bigger than)

if(CalculateCurrentOrders(Symbol())==0 && CheckVolume()==-1) Trade=false; //--------- set Tradeto false provided (no open orders) AND (the candlestick is greater than)

......}

//------- Trade is used in CheckForOpen() function.

void CheckForOpen() //------------------- check conditions and open order

{int res;

if( Trade && A()==-1 && B()==-1) //------- check open conditions

{ res=OrderSend(Symbol(),OP_SELL,Lot,Bid,2,Ask+SL*Point,Bid-TP*Point,"",MAGICMA,0,Red); //--------- if the condition is met, the order is opened

trade=false; } //--------Trade is assigned a trade-ban value. And here it works. If the order closes at the take order, it then waits for the new definite conditions to come, even though the old ones are still in effect (before, the advisor opened orders continuously)

.........}

//-------------------------- check candle height

int CheckVolume()

{ double volume=High[1]-Low[1]; //-------measuring the candlestick height

if (volume <= CandleVolume*Point) return (1); //---------- if the candle is lower than

if (volume > CandleVolume*Point) return (-1);//------------if the candle is more than

return(0);}

Also tried version, but it didn't work:

void start()

{ .....

if(CalculateCurrentOrders(Symbol())==0 && CheckVolume()==1) CheckForOpen();

.....}

.....

int CheckVolume()

{ double volume=High[1]-Low[1]; //-------measurement of candle height

if (volume <= CandleVolume*Point) return (1); //---------- if the candle is lower than

if (volume > CandleVolume*Point) {Trade=false; return (-1);}//------------if the candle is higher than

return(0);}

dzhini:

There's no way it's going to work.

Maybe we should do an indicator first

Vinin:

Maybe we should make an indicator first
and there's no way to do it without it?

Help me out here ! How do I make a print appear once, but on every tick I have a print drop.

```while(OrdersTotal() != 0 && OrderSelect(index, SELECT_BY_POS, MODE_TRADES)){
{
Print ("-------   ",OrderSymbol()," "," BUY ",OrderLots()," trade was opened at ", OrderOpenPrice(),"; Stop loss:", OrderStopLoss(),
"; Take profit:", OrderTakeProfit(), "; Ticket:", OrderTicket(),"; Open time:", OrderOpenTime());
return(0);
}
if(OrderType() == OP_SELL)
{
Print ("-------   ",OrderSymbol()," "," SELL ",OrderLots()," trade was opened at ", OrderOpenPrice(),"; Stop loss:", OrderStopLoss(),
"; Take profit:", OrderTakeProfit(), "; Ticket:", OrderTicket(),"; Open time:", OrderOpenTime());

}
index++;```

itum:

Help me out here ! How do I make a print appear once, but on every tick I get a print drop.

Output this print at the moment of order opening.

sergeev:
output this print when the order is opened.

I need to output information about orders that have already been opened manually or by another EA.

itum:

I need to display information about existing orders that have already been opened manually or by another EA.

Then display them in a comment on the screen. Comment

What is this error? If I send a test mail from the terminal I get an error

- 2010.12.28 18:23:55 Mail: 530 5.7.0 Must issue a STARTTLS command first. y1sm3265289fak.15

dzhini:
and there's no way to do it without it?

You can, of course, but the indicator makes it easy to check the algorithm visually

itum:

I need to display information about existing orders that have already been opened manually or by another EA.

Alternatively, we can make a counter of prints. We declare an integer variable. Then we check if there are no orders, we set it to zero. Then we check if the variable is equal to zero and there are orders in the market, then we print the order data and increment this variable by 1. As soon as the orders are closed, the variable will be set to zero again. This means that the code will wait for at least one order to appear and display information about it in the log.