Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 921

 
solnce600:

Thank you very much.

I need the info to be displayed on the first and only the first minute bar.

The option you offer I tried, ..... but it displays information on 2 and 3 and so on ... because the second bar is not equal to the first and the third is not equal to the second, etc.

I need to print the information once at the first bar. And until the next order is closed by the STOP, thePrint functionshould "rest".

You add conditions to Print() each time. :)

If the conditions are over, we can do it this way:

int  gi_LastTicket = -1;
bool fPrint_Condition()
{
    int li_LastTicket = Функция ищущая последний тикет ордера, закрывшегося по Стопу (ищите у Кима, если нет своей)
    if (li_LastTicket != gi_LastTicket) {gi_LastTicket = li_LastTicket; return (true);}
    return (false);
}
void OnTick()
{
    if (fPrint_Condition()) Print();
}
 
nikelodeon:
Eh.... I wish someone would tell me what the poltergeist is in my code. I'd be glad to have one :-).
The answer has been voiced many times - it's a comparison of double variables.
 
Thank you. I guess that's what I need.
 
TarasBY:
You add conditions each time you execute Print(). :)

If you run out of conditions, you can do this:


Thank you.
 
TarasBY:
The answer has been voiced many times - it's a comparison of double variables.
Yes, but only before I call the order opening procedure I normalise the value of the variable PR. If we need to normalise the value of order opening prices as well. I will try it now...
 
Shit... Well, it's working..... You live and learn.... Thanks BRO!!!!
 
mukata:

Hello

my "start on historical data" button is not active what could be the reason?

Evillive:

Start what?

Start debugging

I can't start debugging on historical data... menu item is there but not active.

Help please!

 
mukata:

Hello

my "start on historical data" button is not active what could be the reason?

Start debugging

I can't start debugging on historical data... menu item is there but not active.

HELP PLEASE!

It does not work for MQL4. It only works for MQL5...

 

Friends, can't anyone help?!( Please, I'd really like an answer!!!

Good day everyone! Please help!!! I dabbled in the simplest martingale EA without indicators and other things, but after updating the language, it does not compile with warnings. Help me to bring it back to life in the updated MT4!

extern int tp = 50;

extern int sl = 30;

double Lots = 0.01;

//+------------------------------------------------------------------+

//| expert initialisation function |

//+------------------------------------------------------------------+

int init()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert deinitialisation function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

//----

if(OrdersTotal()==0)

{

//----

OrderSelect(OrdersHistoryTotal()-1 ,SELECT_BY_POS,MODE_HISTORY) ;

if(OrdersTotal()==0 && OrderProfit()<0)

{

Lots=OrderLots( ) *2;

//-----

if(OrdersTotal()==0 && OrderOpenPrice()<OrderClosePrice())

{

OrderSend("EURUSD",OP_BUY,Lots,Ask,0,Ask-sl*Point,Ask+tp*Point,"",123,0,Red);

}

else

{

OrderSend("EURUSD",OP_SELL,Lots,Bid,0,Bid+sl*Point,Bid-tp*Point,"",123,0,Red);

}

}

else

{

Lots=0.01;

if(OrdersTotal()==0 && OrderOpenPrice()>OrderClosePrice())

{

OrderSend("EURUSD",OP_SELL,Lots,Bid,0,Bid+sl*Point,Bid-tp*Point,",123,0,Red);

}

else

{

OrderSend("EURUSD",OP_BUY,Lots,Ask,0,Ask-sl*Point,Ask+tp*Point,"",123,0,Red);

}

}

}

//----

return(0);

}

//+------------------------------------------------------------------+

Ps: the ex4 file compiled in the old build doesn't work in the new mt4, although the smiley face does.

Thanks so much in advance!!!

 
Hali:

Friends, can't anyone help!( Please, I'd really like an answer!!!

Good day everyone! Please help!!! I dabbled in the simplest Martingale EA without indicators and other things, but after updating the language, it does not compile with warnings. Help to bring it back to life in the updated MT4!

Ps: the ex4 file compiled in the old build does not work in the new mt4, although the smiley face is smiling.

Thank you so much in advance!!!

For future reference: code is inserted in message via SRC button.
Files:
Reason: