sibvic / mq4-templates

MQL4/MT4/MetaTrader 4 templates
http://fxcodebase.com
MIT License
73 stars 36 forks source link

mq4inject and your template #7

Open rp4k opened 9 months ago

rp4k commented 9 months ago

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 commented 9 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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