Jump to content

How to get comments showing on MT4


zoop

Recommended Posts

i have simple EMA ea, price above ema is a buy. price below ema is a sell

 

here is the filter code

 

 

//|---------moving average filter

 

double MAF=iMA(Symbol(),0,MAPeriod,0,MAMethod,MAPrice,i);

 

string MABUY="false";string MASELL="false";

 

if((MAFilter==false)||(MAFilter&&Bid>MAF))MABUY="true";

if((MAFilter==false)||(MAFilter&&Ask<MAF))MASELL="true";

 

 

question, how would i project ema status as comments showing up on mt4 graph?

 

 

eg, price now above MAF- trade long

 

price now below MAF- trade short

 

 

 

thanks...

Link to comment
Share on other sites

Re: (Ask) How to get comments showing on MT4

 

i have simple EMA ea, price above ema is a buy. price below ema is a sell

 

here is the filter code

 

 

//|---------moving average filter

 

double MAF=iMA(Symbol(),0,MAPeriod,0,MAMethod,MAPrice,i);

 

string MABUY="false";string MASELL="false";

 

if((MAFilter==false)||(MAFilter&&Bid>MAF))

{MABUY="true";Comment ("price now above MAF- trade long");}

if((MAFilter==false)||(MAFilter&&Ask<MAF))

{MASELL="true";Comment ("price now below MAF- trade short");}

 

 

question, how would i project ema status as comments showing up on mt4 graph?

 

 

eg, price now above MAF- trade long

 

price now below MAF- trade short

 

 

 

thanks...

 

Hi zoop,

just add the blue command I add to your original post.

Including the { in front of MABUY="true"; and MASELL="true";

Hope this help you.. :D

Link to comment
Share on other sites

Re: (Ask) How to get comments showing on MT4

 

thanks tom for your help, one more question

 

how to add MABUY and MASELL status to other comments already on the EA

 

here is the code

 

 

if(fullcomment)

{

//========Comment Start=======

 

Comment ("","\n","\n","\n","\n","\n",

"\n","...................................... ",

"\n","MA adviser",

"\n","...................................... ",

"\n",( "Current Open Trade Profit/Loss is : ",AccountProfit()),

"\n","...................................... ",

"\n",( "Account Currency:",AccountCurrency()),

"\n","...................................... ",

 

"\n","Currency Spread is ",MarketInfo(Symbol(),MODE_SPREAD),

"\n","...................................... ",

"\n",( "Leverage 1:",AccountLeverage()),

"\n","...................................... ",

"\n",( "Account Balance:",AccountBalance()),

"\n","...................................... ",

"\n" ,"Current Broker Time Is ",TimeToStr(TimeCurrent()));

}

needing MABUY OR MASELL status to show after these

 

thanks again!

Link to comment
Share on other sites

Re: (Ask) How to get comments showing on MT4

 

zoop,

here is the code.

Just add the blue command to your previous original EA.

Please be precise with any of ; ) } etc..

Hope this help you ;)

 

//|---------moving average filter

 

double MAF=iMA(Symbol(),0,MAPeriod,0,MAMethod,MAPrice,i);

 

string MABUY="false";string MASELL="false";string EAcomment;

 

EAcomment= "No suggestion";

if((MAFilter==false)||(MAFilter&&Bid>MAF))

{MABUY="true";EAcomment ="Price now above MAF- trade long";}

if((MAFilter==false)||(MAFilter&&Ask<MAF))

{MASELL="true";EAcomment ="Price now below MAF- trade short";}

 

 

 

// Comment section ====================

 

if(fullcomment)

{

//========Comment Start=======

 

Comment ("","\n","\n","\n","\n","\n",

"\n","...................................... ",

"\n","MA adviser",

"\n","...................................... ",

"\n",( "Current Open Trade Profit/Loss is : ",AccountProfit()),

"\n","...................................... ",

"\n",( "Account Currency:",AccountCurrency()),

"\n","...................................... ",

 

"\n","Currency Spread is ",MarketInfo(Symbol(),MODE_SPREAD),

"\n","...................................... ",

"\n",( "Leverage 1:",AccountLeverage()),

"\n","...................................... ",

"\n",( "Account Balance:",AccountBalance()),

"\n","...................................... ",

"\n" ,"Current Broker Time Is ",TimeToStr(TimeCurrent())

"\n\nEA suggestion: ", EAcomment

);

}

Link to comment
Share on other sites

Re: How to get comments showing on MT4

 

thanks tom, all the other code seems to be fine, but just error message on this part

 

"\n\nEA suggestion: ", EAcomment

);

}

 

'EAcomment'-variable not defined

 

thanks

 

Don't forget to declare "EAcomment" as a string variable:

 

 string EAcomment; 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...