Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mq4inject and your template #7

Open
rp4k opened this issue Sep 14, 2023 · 4 comments
Open

mq4inject and your template #7

rp4k opened this issue Sep 14, 2023 · 4 comments

Comments

@rp4k
Copy link

rp4k commented Sep 14, 2023

when trying to use mq4inject with these templates it doesn't inject the code correctly. is there a more detailed step by step process on how to use mq4inject with your templates.

@sibvic
Copy link
Owner

sibvic commented Sep 15, 2023

Most likely that you just specify the parameters incorrectly. Where the templates are located and what parameters you are using? Could you provide the mq4 code as well?

@rp4k
Copy link
Author

rp4k commented Oct 8, 2023

the only parameters that are listed in the mq4inject.exe
`--sources Required. Path to sources

--source-file Required. Source file.

--target-file Target file. The save as source by default.`

i placed the path of all of the includes in the --sources section
i place the path of the EA that i made in the --source-file section
then i place a --target-file location.

when it compiles it it either has no code inside or it just shows my original code with nothing added
sometimes it will add some of the #include files but only if i first open the original ea i am making and add the #include *.mqh of the ones i want.
but then when it compiles it shows none of the #define sections at the top like it should and also then the ea doesn't compile.

anyway you have telegram so i can get a faster response since i don't look at github often.

@rp4k
Copy link
Author

rp4k commented Oct 8, 2023

mq4inject --sources f:\mq4inject\includemqh\ --source-file f:\mq4inject\test\test.mq4 --target-file done.mq4

when i try this command it just makes another file called done.mq4 but inside is the exact same content of test.mq4

is this because inside test.mq4 i have #include blahblahlbah ??

so the top of my file should look like this below:

#property copyright ""
#property link      ""
#property strict

#define ACT_ON_SWITCH_CONDITION
#define SHOW_ACCOUNT_STAT
#define REVERSABLE_LOGIC_FEATURE
#define STOP_LOSS_FEATURE
#define USE_NET_BREAKEVEN
#define TAKE_PROFIT_FEATURE
#define MARTINGALE_FEATURE
#define USE_MARKET_ORDERS
#define WEEKLY_TRADING_TIME_FEATURE
#define TRADING_TIME_FEATURE
#define POSITION_CAP_FEATURE 
#define WITH_EXIT_LOGIC
#define TWO_LEVEL_TP
#define CUSTOM_SL
#define CUSTOM_TP

#include <Enums/PositionSizeType.mqh>
#include <Enums/StopLossType.mqh>
#include <Enums/StopLimitType.mqh>
#include <Enums/MATypes.mqh>
#include <enums/TakeProfitType.mqh>
#include <enums/DayOfWeek.mqh>
#include <Signaler.mqh>
#include <InstrumentInfo.mqh>
#include <conditions/ActOnSwitchCondition.mqh>
#include <conditions/DisabledCondition.mqh>
#include <conditions/MinMarginCondition.mqh>
#include <conditions/MaxSpreadCondition.mqh>
#include <Streams/AStream.mqh>
#include <Streams/PriceStream.mqh>
#include <OrdersIterator.mqh>
#include <TradingCalculator.mqh>
#include <Order/IOrder.mqh>
#include <Actions/AAction.mqh>
#include <Actions/CreateTrailingStreamAction.mqh>
#include <Actions/PartialCloseOnProfitOrderAction.mqh>
#include <Logic/ActionOnConditionController.mqh>
#include <Logic/ActionOnConditionLogic.mqh>
#include <Conditions/HitProfitCondition.mqh>
#include <Conditions/PositionLimitHitCondition.mqh>
#include <Actions/MoveNetStopLossAction.mqh>
#include <Actions/MoveNetTakeProfitAction.mqh>
#include <Actions/EntryAction.mqh>
#include <MoneyManagement/functions.mqh>
#include <TradingCommands.mqh>
#include <CloseOnOpposite.mqh>
#include <OrderBuilder.mqh>
#include <MarketOrderBuilder.mqh>
#include <EntryStrategy.mqh>
#include <Actions/MoveStopLossOnProfitOrderAction.mqh>
#include <TradingController.mqh>
#include <Conditions/NoCondition.mqh>
#include <AccountStatistics.mqh>
#include <actions/CreateTrailingAction.mqh>
#include <actions/CreateATRTrailingAction.mqh>
#include <actions/CloseAllAction.mqh>
#include <streams/averages/AveragesStreamFactory.mqh>
#include <Streams/SimplePriceStream.mqh>
#include <conditions/ACondition.mqh>
#include <conditions/TradingTimeCondition.mqh>
#include <conditions/AndCondition.mqh>
#include <conditions/OrCondition.mqh>
#include <conditions/NotCondition.mqh>

or is this wrong. I can send you the mq4 file if you have telegram

@rp4k
Copy link
Author

rp4k commented Oct 8, 2023

image
when i try to just compile the normal ea_Base.mq4 with all the included files in mq4/include i get these errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants