Coding help - page 249

 
mladen:
then you can use a function like this one :
void deleteGreatestTicketOrder(datetime timeLimit)

{

int largestTicketNo = -1;

for (int i=OrdersTotal()-1; i>=0; i--)

{

if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;

largestTicketNo = MathMax(largestTicketNo,OrderTicket());

}

//

//

//

//

//

if (largestTicketNo>-1 )

{

if (OrderSelect(largestTicketNo,SELECT_BY_TICKET,MODE_TRADES))

if (OrderOpenTime()>timeLimit)

OrderDelete(largestTicketNo);

}

}
PS: it does not make a difference among symbols or eventual magic numbers. If you need those to be checcked too, than some additional code needs to be added to the above function

Awesome Thanks a lot . . .

 

mr. mladen, my question, please?

Files:
ignore-me.jpg  10 kb
 
olvus:
mr. mladen, my question, please?

Never used thinkorswim and I am unfamiliar with their coding language (all have some specifics and right now I do not have a time to learn yet another coding language)

If it is Tushar Chandes dynamic momentum index (DMI), and it looks like it, then check these posts :
https://www.mql5.com/en/forum/general

https://www.mql5.com/en/forum/general

PS: as of "ignoring" - don't you think that there is a perfectly rational reason why some post gets un-answered. Thinkorswim is not a wide spread trading platform and those that code using its coding language are rather rare - why are you assuming that I must know that coding language too? I do "speak" some 14-15 coding languages but among 100s that exist it is almost nothing

 

ok, thank you

 

Hello, I would like some help with this EA HI-LO, I wish the same to add the pending order, attach a 10 pip the hight or low, do not know if here is the right place to post this, if not ask sorry, thank you.

Files:
barhilo.mq4  4 kb
 
mladen:
Tsar Do yo have a code of that indicator that is not a decompiled code?

I haven't it. It seem like MACD All colored & arrows indie concept's

mladen:
Btw: that is a simple MACD with an EMA average of a signal line added to it. Check the MACD thread (this one : https://www.mql5.com/en/forum/178018 ) I am almost sure that you can find it there

I've been looking for and didn't find it

A friend gaveK-MACD indicator ( based MT4 Build 509 ) to me. Almost close to what I want. Because have SMA line as a further guide the Trend.

Oh Dear... He won't to give the MQ4 files.

Files:
 
wendvieira:
Hello, I would like some help with this EA HI-LO, I wish the same to add the pending order, attach a 10 pip the hight or low, do not know if here is the right place to post this, if not ask sorry, thank you.

Just replace the buyPrice part in this line

if(High[1]-Ask < stoplevel) buyPrice = Ask+ RangePoint*point();

with buyPrice = MathMax(High[0],Ask) + RangePoint*point();

and sellPrice part in this line

if(Bid-Low[1] < stoplevel) sellPrice = Bid - RangePoint*point();

with sellPrice = MathMin(Low[0],Bid) - RangePoint*point();

 
Tsar:
I haven't it. It seem like MACD All colored & arrows indie concept's

I've been looking for and didn't find it

A friend gaveK-MACD indicator ( based MT4 Build 509 ) to me. Almost close to what I want. Because have SMA line as a further guide the Trend.

Oh Dear... He won't to give the MQ4 files.

Tsar

That is simply a macd with one more signal line added (the histogram is a regular osma - osma from a macd using ema for signal line not as the metatrader built in macd that uses sma as we all know)

 

Hello Mladen , im trying to get the value of lastPrice = OrderOpenPrice(); using pass by rerference.

I use this

int LastMktOrder(double &lastPrice)

based on the examples from MQL4 site, but i keep getting a compile error

'lastPrice' - variable not defined .

Could you please take a look at the code. Thanks

Files:
 
sulaimoney:
Hello Mladen , im trying to get the value of lastPrice = OrderOpenPrice(); using pass by rerference.

I use this

int LastMktOrder(double &lastPrice)

based on the examples from MQL4 site, but i keep getting a compile error

'lastPrice' - variable not defined .

Could you please take a look at the code. Thanks

sulaimoney

Try it this way (attached the changed code)

Files:
Reason: