Simple experts - page 20

 
Anyway:

like this:

if (DisplayInfo)
    Comment("Current profit : "+DoubleToStr(currentProfit,2)+" "+AccountCurrency()+"\nMagicNumber,123456");

Hi Anyway,

  Thanks for your help,it worked :) ..... but with out "ORDER TICKET" number,can you guide me how to add order ticket number along with magic number or at next lower line,is it possible to print on chart server time (brokers) at next lower line ..... i want improve this simple EA step by step as an complete full figured/functional EA.

I don't know a bit of coding matters but i am keen interested to upgrade this ea :)

regards


 
mntiwana:

Hi Anyway,

  Thanks for your help,it worked :) ..... but with out "ORDER TICKET" number,can you guide me how to add order ticket number along with magic number or at next lower line,is it possible to print on chart server time (brokers) at next lower line ..... i want improve this simple EA step by step as an complete full figured/functional EA.

I don't know a bit of coding matters but i am keen interested to upgrade this ea :)

regards


Dearest MNTIWANA

want to show "Order ticket" number needs add a global variable :)

print on chart server time:

if (DisplayInfo)
    Comment("Current profit : "+DoubleToStr(currentProfit,2)+" "+AccountCurrency()+"\nMagicNumber,123456"+ "\nServer time: "+TimeToString(TimeCurrent(),TIME_DATE|TIME_SECONDS));
 
Anyway:

Dearest MNTIWANA

want to show "Order ticket" number needs add a global variable

print on chart server time:

if (DisplayInfo)
    Comment("Current profit : "+DoubleToStr(currentProfit,2)+" "+AccountCurrency()+"\nMagicNumber,123456"+ "\nServer time: " + TimeToString(TimeCurrent(),TIME_DATE|TIME_SECONDS));

Anyway

Again much thanks for taking your time and kind help, i added and is working :)

and if global variable you cant manage :)

regards


 
mntiwana:

Anyway

Again much thanks for taking your time and kind help, i added and is working :)

and if global variable you cant manage :)

regards


Dearest MNTIWANA

Try it out 

 
Anyway:

:)

int ticket; //global variable
//------------------------------------------
   if (OrderType()==OP_BUY)
            if (doWhat==_doSell)
                  { RefreshRates(); if (!OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,CLR_NONE)) openedBuys++; }
            else  openedBuys++;
         if (OrderType()==OP_SELL)
            if (doWhat==_doBuy)
                  { RefreshRates(); if (!OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,CLR_NONE)) openedSells++; }
            else  openedSells++;            
   }

string strTicket = openedBuys+openedSells<1 ? "" : "\nOrder ticket: "+IntegerToString(ticket);

if (DisplayInfo)
    Comment("Current profit : "+DoubleToStr(currentProfit,2)+" "+AccountCurrency()+"\nMagicNumber,123456"+strTicket+ "\nServer time: "+TimeToString(TimeCurrent(),TIME_DATE|TIME_SECONDS));

//-----------------------------
...
ticket = OrderSend(...);
...

HI Anyway

Thanks for your concern but i am sure i did some thing wrong with code,paste on wrong place :) ...  (errors and warning)

plz look in the code and correct,so kind of you.

regards

 
mntiwana:

HI Anyway

Thanks for your concern but i am sure i did some thing wrong with code,paste on wrong place :) ...  (errors and warning)

plz look in the code and correct,so kind of you.

regards

 Dearest MNTIWANA

 I have edited the previous post (#195) when you took the time to replied to it. :(

 Because I saw you upload the attachment, so ...

 
Anyway:

 Dearest MNTIWANA

 I have edited the previous post (#195) when you took the time to replied to it. :(

 Because I saw you upload the attachment, so ...

Anyway

So kind of you,it is working well :)

looks we are pushing it up step by step,your skill helping me a lot,appreciations.

here is a small snippet regarding error sending but i don't know is it right and perfect code .... and where to add it,can you guide me plz.

i think after adding this error sending message, our EA will be of ver 1.4 , a lot of improvement of today :)

regard

#include <stderror.mqh>
#include <stdlib.mqh>
void SendMyMessage(string text)
  {
   int check;
   SendMail("Test", text);
   check=GetLastError();
   if(check!=ERR_NO_ERROR) Print("Message not sent. Error: ",ErrorDescription(check));
  }
 
mntiwana:

Anyway

So kind of you,it is working well :)

looks we are pushing it up step by step,your skill helping me a lot,appreciations.

here is a small snippet regarding error sending but i don't know is it right and perfect code .... and where to add it,can you guide me plz.

i think after adding this error sending message, our EA will be of ver 1.4 , a lot of improvement of today :)

regard

#include <stderror.mqh>
#include <stdlib.mqh>
void SendMyMessage(string text)
  {
   int check;
   SendMail("Test", text);
   check=GetLastError();
   if(check!=ERR_NO_ERROR) Print("Message not sent. Error: ",ErrorDescription(check));
  }

Hey, guy

It will sure fetch huge profits!

Let us hope so. :)

 
Anyway:

Hey, guy

It will sure fetch huge profits!

Let us hope so. :)

Anyway

So much thanks for your interesting help ... of course we will do our best to make-upgrade it till possible limits to meet today trading requirements along with all accessories that make us/user comfort and secure :)

do you think  this last snippet will be do exact when happens some thing wrong with order/terminal/server and all that concern to it,as i tested with less stop loss but it did not inform me or give/print any message/warning that stop loss level is less than required by broker,only trade was not taken.

or do you think we need some other code snippet for this purpose....error list attached (2 pictures)

regards


 
mntiwana:

Anyway

So much thanks for your interesting help ... of course we will do our best to make-upgrade it till possible limits to meet today trading requirements along with all accessories that make us/user comfort and secure :)

do you think  this last snippet will be do exact when happens some thing wrong with order/terminal/server and all that concern to it,as i tested with less stop loss but it did not inform me or give/print any message/warning that stop loss level is less than required by broker,only trade was not taken.

or do you think we need some other code snippet for this purpose....error list attached (2 pictures)

regards


If you are checking the OrderSend() no changes to that code snippet needed

If you are checking OrderModify() probably ERR_NO_RESULT should be omitted too (so :

if(check!=ERR_NO_ERROR && check!=ERR_NO_RESULT) Print("Message not sent. Error: ",ErrorDescription(check));
Reason: