Extern bool

 

Dear All

when I change my variable (Money_management) to true or false, by launching my program, I do not get the desired result.
indeed if I leave by default in my program at FALSE, and I change my variable at launch, this is not taken into account.
I can't find my mistake.
can you please help me?
Thank you

 

Forum on trading, automated trading systems and testing trading strategies

When you post code please use the CODE button (Alt-S)!

Use the CODE button


 
/
//+------------------------------------------------------------------+
//|                                                      EXTERNE.mq4 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
extern bool Money_management = false ;

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

   Print ("Money_management est   : " ,Money_management);

  }

 
Sergey Golubev:

thk Sergey. i have do it
 
  1. You should have edited your original post, don't repost your code. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  2. Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

 
viiozzo:

Dear All

when I change my variable (Money_management) to true or false, by launching my program, I do not get the desired result.
indeed if I leave by default in my program at FALSE, and I change my variable at launch, this is not taken into account.
I can't find my mistake.
can you please help me?
Thank you

I tested it and It is changing.

 

Thk for your answer Mafuta Landou.

It's works in MT4 in real but not in strategy tester :-(

Reason: