how to use ChartRedraw() - page 2

 
Code2219 or 2319 #:

what I meant is:

Nope same thing. I can post the full ea code with resources and includes to your private pm if you think that it could be a challenge for you. I can pay you in freelance or buy 1 of your market products if you so wish.

 

send me the summarized code I'll have a look.

and lol I don't sell anything here

 
Michael Charles Schefe:
How do I use ChartRedraw()? I have my comment/OSD function like so... and eqplus iStartLots and Spread is in ea inputs.

I have it 

But the OSD/comment on the chart does not get updated after I change the inputs.

NOTE that I want these inputs Spread, iMinialProfit, iSlippage to change in the chart comment/osd when I change them in the ea inputs.

How do I make my OSD to change and update my OSD/chart comment to change and update when I change them in my ea settings?

OnInit is called after you have changed EA inputs, you can test it easily with the attached code.

So what you need to decide is if the data you are trying to show is available/updated at the time you are requesting and showing it, which is not always the case during OnInit.  but your EA  inputs will be so it should not be an issue for those.

#property strict

input string   input1 = "Hello";
input int      input2 = 5;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   ShowComment();
   return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{

}
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{

}
//+------------------------------------------------------------------+

void ShowComment()
{
   Comment("Comment updated: " + GetTickCount() + "     " + input1 + "  " + input2); 
}
 
Paul Anscombe #:

OnInit is called after you have changed EA inputs, you can test it easily with the attached code.

So what you need to decide is if the data you are trying to show is available/updated at the time you are requesting and showing it, which is not always the case during OnInit.  but your EA  inputs will be so it should not be an issue for those.

Code2219 or 2319 #:

send me the summarized code I'll have a look.

and lol I don't sell anything here

I found my problem. I had the first 2 variables in my comment "Profit Target: XXXX" and "Minimal Profit Per Trade: XX" as static and const variables.

static double eqplus = iEquityStop*iStartLots*10;
I turned these 2 into plain double variables that multiplied 2 of the inputs, and now my Comment updates upon changing of my ea settings.

Thanks for persevering with me!