Not logged in
Viewing 6 posts - 1 through 6 (of 6 total)

Forums>StrategyQuant>General Discussion>CustomParameterMT4 & CustomCodeMT4

  • #114050|
    Customer
    447 Posts

    If the following is included in CustomParameterMT4 will it override the parameters in the mql4 generated by SQ?

     

    /**
     * add your own parameters that will be included in every EA
     * into file /code/CustomParametersMT4.mq4
     */
    //extern bool TradeOnHour1 = true;
     
     
    extern bool UseMoneyManagement = true;
    extern double Lots = 1;
    extern int LotsDecimals = 2;
    extern double RiskInPercent = 1.0;
    extern double MaximumLots = 10;
    extern bool UseFixedMoney = false;
     

     

     

    Can a very  simple example of CustomCodeMT4 be made available?

     

    Thanks

    #132133
    Moderator
    1578 Posts

    Yes those manually defined parameters should override defaults since its place into output code behind default values

     

    You can place any piece of MQL4 code into CustomCodeMT4. It is similar to standard function calls. Look here http://docs.mql4.com/basis/function/events#oninit

    #140654
    Customer
    447 Posts
    Hi,
     
    I have attempted to use CustomParametersMT4 but it doesn’t override the EA parameters.  Am I doing something wrong or is it a SQ glitch?
     
    Does “/file” means create a directory called ‘file’ then copy CustomParametersMT4 there ?  Is “/file”  a typo meaning it should be copied into the default folder ‘files’?  Or does “/file” mean the  EA file location.  The SQ3 instructions are a little ambiguous so clarification is urgently sought.
     
    Thank you
    #140673
    Moderator
    1578 Posts

    Hello,

     

    it seems the MQL compiler cannot handle parameters being defined more than once. Hence there is a problem with parameters override. I will ask Mark about this what can be done

    #140728
    Moderator
    1578 Posts

    Hello,

     

    just to confirm you cannot “overwrite” variables using CustomParametersMT4 . This serves only for defining your own additional parameters

    #140730
    Customer
    447 Posts

    Thank you.

     

    I’ve changed the external parameters to global variables which has solved my problem.  

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.