[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 417

 

When it comes to MT with 5 digits after the decimal point, if let's say I want to output the value High[0] in Comment, a number with 4 digits after the decimal point will appear.

- How do I get the full value?

 

Hello Programmers.


Please help me write the following code: if an order is closed on a stop loss, I want to open a new one in the opposite direction. I want to try this add-on to my previously created EA.


Thanks in advance.

 

Good afternoon, friends.


Please advise me on what to do.


The situation is as follows: I am testing the Expert Advisor on a demo account.

I am trying to open/close my positions as follows:


if ( (ind1()==1)&&(ind2()==1))
{
if (buy_order_open == 0 )
{

ticket = OrderSend(Symbol(), OP_BUY, lots,NormalizeDouble(Ask, Digits), 3, NormalizeDouble(Bid, Digits) - sl * Point, 0, "Buy", MagicNumber, 0, Blue);
if(ticket < 0)
{

Sleep(30000);

prevtime = Time[1];

}
buy_order_open = 1;

}
}
//===============================================
if ( (ind1()==2)&&(ind2()==2))
{
if ( sell_order_open == 0 )
{

ticket = OrderSend(Symbol(), OP_SELL, lots, NormalizeDouble(Bid, Digits), 3, NormalizeDouble(Ask, Digits) + sl * Point, 0, "Sell", MagicNumber, 0, Red);

if(ticket < 0)
{

Sleep(30000);

prevtime = Time[1];

}
sell_order_open = 1;

}
}
//=============

I.e., I place orders with a stop loss.


I am trying to open a position in a real time mode, but when I open a position, I get a message like this:



I.e. the position is opened without a stop loss?


What is the problem here?

 

Gentlemen programmers! I have a question! How can I display crossing of the MA indicator with PRICE_HIGH of the previous bar in the code?

I understand that we need arrays to determine the highest price of the previous bar. The whole question is to solve the crossing of the price data and the indicator!

 
profi >>:

...Как в коде отобразить пересечение индикатора МА с PRICE_HIGH предыдущего бара?...

The crossing of your MA with the MA with period 1 and the PRICE_HIGH price.
 
Morzh09 >>:

Друзья, добрый день.


Посоветуйте, плз, что предпринять.


Ситуация следующая: тестирую советника на демо-счете.

строки на открытие/закрытие позиции выглядят так:


Тоесть, выставляю ордера со стоп-лоссом.


А при работе на реал-тайм, при открытии позиций, мне выскакивает такое окошечко:



Т.е. позиция открывается уже изначально без стоп-лосса!?!?


В чем здесь проблема???

you must have "manual confirmation" checked in the EA settings

 
dmmikl86 >>:

у вас наверное поставлена галочка "ручное потверждение" в настройках советника


How can I get rid of this, please advise.


The thing is, I have removed the check mark for "Manual confirmation" in the "Service" settings.


But, if I disable the checkbox at the moment when I put the EA on the chart (i.e. the EA should work in automatic mode), the EA does not make a single trade...

 
maybe the broker does not allow the use of advisers....
 
granit77 >>:
Пересечение вашей МА с МА с периодом 1 и с ценой PRICE_HIGH.

the code itself roughly looks like this IF IMA > PRICE HIGH OP_SELL, where IMA is the MA indicator

it is approximately... the last two bars are taken into account

 
profi >>:

сам код примерно выглядит так IF IMA > PRICE HIGH OP_SELL, где IMA- это индикатор МА

это примерно... в расчёт берутся два последних бара

It is not an intersection, it is a comparison of values. In my version your code would look like this (although describing the intersection itself would be better):

if( IMA>iMA(NULL,0,1,0,MODE_EMA,PRICE_HIGH, SignalBar))