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

 

Good afternoon! Every time you change the checkbox, you have to reset the variable once. What is the easiest way to do it?

bool flag; int reset=0;

 
abeiks:

Good afternoon! Every time the flag is changed, we need to reset the variable once. What is the easiest way to do it?

bool flag; int reset=0;

We need to create another variable in which to remember the previous value and compare it to flag:

bool flag=0, flag1=0;
int reset=0;

void OnTick()
{
////...............
  if(flag1!=flag)
  {
   reset=0; 
   flag1=flag;
  }
////............
}
 

There is a list of pointers called List. There is a CDouble object which stores a variable of type double. Accordingly, the CDouble object has a Get() method to return the stored value. The pointer to the CDouble object is stored in List.

CList *List;
List = new CList;
List.Add(new CDouble(5.1));
I tried to get the variable's value from this construct:
List.GetNodeAtIndex(0).Get();
But the compiler didn't recognize it. Later I understood that I get a pointer to an object of CObject type and not CDouble, therefore the Get method isn't defined for CObject.
Question: how to get a value from a CDouble object, by its pointer placed in List, in one line of code?
 
evillive:

Create another variable in which to store the previous value and compare it with flag:


Thank you.
 
Good evening all. Please advise how to disable news and market in MT4, if such a possibility exists. Thank you.
 
What, nobody knows? Or is it impossible? Then another layman's question: many times I have observed on a demo account that the free margin goes into deficit, funds turn out to be less than the margin, and no margin call takes place. Why? And does this happen on the real account?
 
Well, I've turned off the news, but I can't find how.
 
rapid_minus:
Well, I turned off the news, but I can't find how to turn off the market.
Write to your broker, he will disable it if he wants, some brokerage companies disable the default signals tab on demo.
 
Thank you. Only dealing with brokers, due to my soft-heartedness, constantly puts me at a loss. I've already stopped taking their calls. God be with this market.
 
No, and the news hasn't turned off either. I unchecked all the boxes, but when I restart the platform, the news still keeps coming. And the news is useless.
Reason: