Friendship is friendship, but tobacco is apart... The full code will be for this one:
notused:
give full code with standard library (can't do it myself as I'm no expert in standard library) ...
--
not for the good, but for the bad... For you will lose your grasp of reality... learn OOP.
At this point I think the question is over.
Comrade, you don't have to teach me about OOP, I can teach anybody, and not only about OOP. I asked for a code to compare what you need to write to open a deal with the help of the standard library and what you need to write without it. And what is easier to understand in the end? It seems to be quite a constructive suggestion.
Comrade, I don't need to be taught about OOP, I can teach anyone, and not only about OOP. And I asked for a code to compare what you need to write to open a deal with the help of the standard library and what you need to write without it. And what is easier to understand in the end? It seems to be quite a constructive suggestion.
Well, no, so no.
I have written everything.
File in directory Include:
class МойСигнальщик : public CExpertSignal //наследуемся от Signal
{
private:
CiCustom МойИндикатор;
public:
МойОбработчик();
~МойОбработчик();
bool ValidationSettings(void);
bool InitIndicators(CIndicators *indicators);
virtualint LongCondition();
virtualint ShortCondition();
protected:
bool МойИндикатор(CIndicators *indicators);
int МойСигнальщик::LongCondition()
{
int signal=0;
if (!signalLong0==0)
{
signal=100;
}
return(signal);
}
In the Expert Advisor:
#include <МойСигнальщик.mqh>inputdouble Signal_StopLevel =150.0; // Stop Loss level (in points)inputdouble Signal_TakeLevel =120.0; // Take Profit level (in points)inputdouble Signal_PriceLevel =10.0; // Price level to execute a dealinputdouble Money_FixLot =1.0;
CExpert ExtExpert;
//+------------------------------------------------------------------+//| Initialization function of the expert |//+------------------------------------------------------------------+intOnInit()
{
//--- Initializing expertif(!ExtExpert.Init(Symbol(),Period(),Expert_EveryTick,Expert_MagicNumber))
{
//--- failedprintf(__FUNCTION__+": error initializing expert");
ExtExpert.Deinit();
return(-1);
}
//--- Creating signal
CExpertSignal *signal=new CExpertSignal;
if(signal==NULL)
{
//--- failedprintf(__FUNCTION__+": error creating signal");
ExtExpert.Deinit();
return(-2);
}
//---
ExtExpert.InitSignal(signal);
signal.ThresholdOpen(Signal_ThresholdOpen);
signal.ThresholdClose(Signal_ThresholdClose);
signal.PriceLevel(Signal_PriceLevel);
signal.StopLevel(Signal_StopLevel);
signal.TakeLevel(Signal_TakeLevel);
signal.Expiration(Signal_Expiration);
//--- Creating filter IRTMiniMax
МойИндикатор *filter0=new МойИндикатор;
if(filter0==NULL)
{
//--- failedprintf(__FUNCTION__+": error creating filter0");
ExtExpert.Deinit();
return(-3);
}
signal.AddFilter(filter0);
//--- Set filter parameters
filter0.Weight(Signal_MovingMM_Weight);
//--- Creation of trailing object
CTrailingNone *trailing=new CTrailingNone;
if(trailing==NULL)
{
//--- failedprintf(__FUNCTION__+": error creating trailing");
ExtExpert.Deinit();
return(-4);
}
//--- Add trailing to expert (will be deleted automatically))if(!ExtExpert.InitTrailing(trailing))
{
//--- failedprintf(__FUNCTION__+": error initializing trailing");
ExtExpert.Deinit();
return(-5);
}
//--- Set trailing parameters//--- Creation of money object
CMoneyFixedLot *money=new CMoneyFixedLot;
if(money==NULL)
{
//--- failedprintf(__FUNCTION__+": error creating money");
ExtExpert.Deinit();
return(-6);
}
//--- Add money to expert (will be deleted automatically))if(!ExtExpert.InitMoney(money))
{
//--- failedprintf(__FUNCTION__+": error initializing money");
ExtExpert.Deinit();
return(-7);
}
//--- Set money parameters
money.Lot(Money_FixLot);
//--- Check all trading objects parametersif(!ExtExpert.ValidationSettings())
{
//--- failed
ExtExpert.Deinit();
return(-8);
}
//--- Tuning of all necessary indicatorsif(!ExtExpert.InitIndicators())
{
//--- failedprintf(__FUNCTION__+": error initializing indicators");
ExtExpert.Deinit();
return(-9);
}
//--- okreturn(0);
}
//+------------------------------------------------------------------+//| Deinitialization function of the expert |//+------------------------------------------------------------------+voidOnDeinit(constint reason)
{
ExtExpert.Deinit();
}
//+------------------------------------------------------------------+//| "Tick" event handler function |//+------------------------------------------------------------------+voidOnTick()
{
ExtExpert.OnTick();
}
//+------------------------------------------------------------------+//| "Trade" event handler function |//+------------------------------------------------------------------+voidOnTrade()
{
ExtExpert.OnTrade();
}
//+------------------------------------------------------------------+//| "Timer" event handler function |//+------------------------------------------------------------------+voidOnTimer()
{
ExtExpert.OnTimer();
}
//+------------------------------------------------------------------+
notused: What's easier? fill in one structure or deal with signals?
That's the thing... The Signal in this particular case can be a text message from your phone... but when you tell your advisor exactly what to do... he'll do it...
I can do anything on the Signal, as long as the suit fits... I'm already on ATC2012)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Friendship is friendship, but tobacco is apart... The full code will be for this one:
notused:
give full code with standard library (can't do it myself as I'm no expert in standard library) ...
--
not for the good, but for the bad... For you will lose your grasp of reality... learn OOP.
At this point I think the question is over.
Comrade, you don't have to teach me about OOP, I can teach anybody, and not only about OOP. I asked for a code to compare what you need to write to open a deal with the help of the standard library and what you need to write without it. And what is easier to understand in the end? It seems to be quite a constructive suggestion.
Well, no, so no.
A BIG THANK YOU to everyone!
sent
Waiting for verification
With any luck we will meet at the Automated Trading Championship 2012!
Good Luck to all of you!
(I have to learn ...)
Comrade, I don't need to be taught about OOP, I can teach anyone, and not only about OOP. And I asked for a code to compare what you need to write to open a deal with the help of the standard library and what you need to write without it. And what is easier to understand in the end? It seems to be quite a constructive suggestion.
Well, no, so no.
I have written everything.
File in directory Include:
In the Expert Advisor:
That's all...
Teach me about OOP, please
And the whole thing is already ready and there's no need, again, to reinvent the wheel...
A BIG THANK YOU to everyone!
sent
Waiting for verification
With any luck we will meet at the Automated Trading Championship 2012!
Good Luck to all of you!
(I have to learn ...)
which is easier? filling one structure or dealing with signals?
Oof )) Congratulations. Now we'll have to cheer for you ))
What's easier? fill in one structure or deal with signals?
That's the thing... The Signal in this particular case can be a text message from your phone... but when you tell your advisor exactly what to do... he'll do it...
I can do anything on the Signal, as long as the suit fits... I'm already on ATC2012)
Yes, that's the way to go.
but more often than not.