Download MetaTrader 5

costume candle close help neede - page 3

To add comments, please log in or register
Carl Schreiber
6687
Carl Schreiber 2014.10.14 07:37  

It's getting better! But still not good enough :)

I have to repeat:

Not you know what OrderSelect(..) returns, why, and what you can do with it? Same with OrderClose().

It's all in "Moving Average.mq4" in your expert folder!!

PieroNetto
189
PieroNetto 2014.10.14 11:05  
int start()
{
      bool resOS,resOC;
      resOS=OrderSelect(0,SELECT_BY_POS,MODE_BASE);
      if(OrderProfit()>0.15)
      if(OrderOpenTime()<iTime[0])
      if(OrderType()==OP_SELL)
      resOC=OrderClose(OrderTicket(),OrderLots(),Bid, 3);
return(0);
}

Hi there!

Now it works the way i want.

but there is now a new problem with it. 

 if(OrderOpenTime()<iTime[0]) that is my problem.

If there is the open trade in the current candle it close the trade at candle close if it is bigge then 15cent by 0.01 lot.

Is it smaller then 15cent it keeps the trade open. So far so good. But follow up candles closing only at 15cent why we are executing the line of  

  if(OrderOpenTime()<iTime[0]).

how do i code it not from OrderOpenTime.

I hope u understand what i mean.

Thanks a lot for helping me. 

Carl Schreiber
6687
Carl Schreiber 2014.10.14 11:16  

" why we are executing the line of   if(OrderOpenTime()<iTime[0])."

You should know, it's your code?

PieroNetto
189
PieroNetto 2014.10.14 11:47  

Dont understand u question!?

i said it all above whats my goal here 

u know im fresh to this. u answers are a bit ????????

If i know i would not ask for help.

thanks again 

Keith Watford
Moderator
9640
Keith Watford 2014.10.14 12:36  
pieronetto:

Dont understand u question!?

i said it all above whats my goal here 

u know im fresh to this. u answers are a bit ????????

If i know i would not ask for help.

thanks again 


 
 u is not a word, remember that not everyone on the forum is a native English speaker. To many, your post is nonsense!
PieroNetto
189
PieroNetto 2014.10.14 13:23  

I'm not a native english speaker either.

 sorry about it if it is a problem on this forum site

PieroNetto
189
PieroNetto 2014.10.14 13:29  

Still having that problem above

Hoping for some pointers or links where I can look at it

Sure someone else discuss this before

Thanks

Carl Schreiber
6687
Carl Schreiber 2014.10.14 13:35  
pieronetto:

Dont understand u question!?

i said it all above whats my goal here 

u know im fresh to this. u answers are a bit ????????

If i know i would not ask for help.

thanks again 

1) It is your code, you should know, why it is there and why you have placed it there.

2) Try to understand what the line does read the reference about the functions

3) Play with that line ..

4) To learn coding use the example of others, read the docs, do a workshop,  ...

123
To add comments, please log in or register