Questions from a "dummy" - page 42

 
uncleVic:
It means that there is no price set in the structure of the trade execution result.

That is, if there are zeros, then I am doing something wrong? When testing in the tester, all trades open successfully, but all trades have[done at 0.0000].

And in real time on a demo account this is not observed:

I am probably misunderstanding something. ))) Please clarify.

 
uncleVic:
This means that no price has been set in the structure of the trade's execution result.
What price and why not set? And why display it if there is no other value? And for whom is it displayed if no one knows what it is?
 
Valmars:
What is the price and why is it not set ? And why display it if there is no other value ? And for whom is it displayed if no one knows what it is ?
Perhaps the tester is underfilling something. Let's find out.
 
uncleVic:
Maybe Tester fills something incomplete. We'll find out.

Well, I assumed something like that and didn't ask any questions - it's not critical, sooner or later I'll get around to it. But since the question came up, I decided to support it.

Thanks for the reply.

 
uncleVic:

If so, you will have to implement your algorithms yourself in your CExpertSignal derived class,


that's fine, but

uncleVic:

overloading appropriate methods and then inserting them into the source obtained from the Wizard

can we have a simple example?
 

There are 8 arrays USD[ ],EUR[ ],.......... Is it possible to programmatically substitute the name of the array, i.e. USD and EUR from the array with the name Sym{"USD", "EUR",......}? Is there another approach?

 
Lodar:

that's fine, but...

can we have a simple example?

For example:

...
class CMyExpertSignal : public CExpertSignal
  {
public:
   virtual double Direction()
     {
      //--- алгоритм отличный от реализованного в классе CExpertSignal
     }
   virtual bool OpenLongParams(double& price,double& sl,double& tp,datetime& expiration)
     {
      //--- алгоритм отличный от реализованного в классе CExpertSignal
     }
   virtual bool OpenShortParams(double& price,double& sl,double& tp,datetime& expiration)
     {
      //--- алгоритм отличный от реализованного в классе CExpertSignal
     }
  };
...
//+------------------------------------------------------------------+
//| Initialization function of the expert                            |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- Initializing expert
...
//--- Creating signal
   CExpertSignal *signal=new CMyExpertSignal;
   if(signal==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating signal");
      ExtExpert.Deinit();
      return(-2);
     }
//---
 
uncleVic:

For example:

cool, thanks, I got it, can I make it do both sell and buy at the same time ? for example it removes pending sells and puts a buy, I did it like this
bool MyClass::CheckCloseLong( double&  price)
{
   return(false);
}

bool MyClass::CheckCloseShort( double&  price)
{
   return(false);
}
but it refuses to do that :)
 
Lodar:
Great, thanks, I got it, but can I get it to place both sell and buy at the same time? For example, it removes pending sells and places buy, I did it like this
but it refuses to place too :)
You have to modify (inherit and change algorithms) CExpert class.
 
uncleVic:
It is necessary to refine (inherit and change algorithms) the CExpert class.
Got it all figured out, thanks!
Reason: