Re: Coding Help

591
alozard wrote: Mon Dec 11, 2017 8:44 pm Hi Mladen
Can you turn this indicator into an English version?
Thanks
If you know the character set used e.g Cyrillic you can copy | paste the entire MQ4 text into Notepad++ app and select Encoding | Character Sets | Cyrillic | (say) Windows-1251 and if it is Cyrillic WIndows-1251 it will convert all the "squiggles" to (say) Russian characters and leave the wording that is readable English intact. Then and only then can you copy | paste, section by section or selectively word by word, into Google.translate to get it into English language.

The point is it is not a matter of merely translating a language from-to. The "squiggles" are MetaEditor's character substitution of characters it does not understand. Encoding into the correct symbol set reveals the native language and from there it is a straight forward (but time consuming) exercise of regular language translation.

Notepad++ is an excellent free app and is searchable to find an installer file.

I hope this helps.


Re: Coding Help

593
alozard wrote: Mon Dec 11, 2017 8:44 pm Hi Mladen
Can you turn this indicator into an English version?
Thanks
Alozard. I am curious. Can you explain what it does and how/why it is useful? Maybe a screenshot? If you haven't completed the translation, I could do do it if there is some benefit to our forex-station peers. I stopped after about 1 hour, mostly because there was a large amount of translations and constant use of Ctrl+H (Find and Replace) in case there are more than one incidence of most recent word/phrase translation.

Re: Coding Help

594
Dear Mladen,

I have a question regarding the price and MA instances.
Let's use the following example - should we use the expression

Code: Select all

iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,0),APeriod,i,0) >
iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,1),APeriod,i+1,1)
that is, with two instances of both (the same) price and (the same) MA, or

Code: Select all

iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,0),APeriod,i,0) >
iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,0),APeriod,i+1,0)
that is, the single instances?

Re: Coding Help

595
Sorry, it should be

Code: Select all

iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,0),APeriod,i,0) >
iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i+1,1),APeriod,i+1,1)
and

Code: Select all

iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,0),APeriod,i,0) >
iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i+1,0),APeriod,i+1,0)
respectively. (I can't edit the previous post.)


Re: Coding Help

598
wojtek wrote: Tue Dec 19, 2017 8:40 am Dear Mladen,

I have a question regarding the price and MA instances.
Let's use the following example - should we use the expression

Code: Select all

iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,0),APeriod,i,0) >
iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,1),APeriod,i+1,1)
that is, with two instances of both (the same) price and (the same) MA, or

Code: Select all

iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,0),APeriod,i,0) >
iCustomMa(AMode,getPrice(APrice,Open,Close,High,Low,i,0),APeriod,i+1,0)
that is, the single instances?
Whenever you use new price, period or type (in the same loop) then you must use new average instance

CodeRe: Coding Help

600
Hi coder please guide me how change my this code.

I want ea set one tp for last OPEN order for all my previous open order like this image.

if(use_auto_tp) tp_prev_f();



////////////////////////////////////////////////////////////////////
void tp_prev_f()
{
int type;
double prev_price=-1;
double prev_tp=-1;
bool first=false;
for (int i=0; i<OrdersTotal(); i++)
{
if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
if(OrderMagicNumber()!=Magic || OrderSymbol()!=Symbol()) continue;
if(!first)
{
first=true;
prev_price=OrderOpenPrice();
prev_tp=OrderTakeProfit();
continue;
}

type=OrderType();


if (type==OP_BUY)
{
if (Bid>=prev_price && OrderTakeProfit()<prev_tp)
{
if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),prev_tp,0,clrNONE)) continue;
}
}
else
if (type==OP_SELL)
{
if (Ask<=prev_price && OrderTakeProfit()>prev_tp)
{
if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),prev_tp,0,clrNONE)) continue;
}
}
}
Attachments


Who is online

Users browsing this forum: No registered users and 14 guests