FORTS Please help - page 25

 
couldn't find it on the forum, can anyone tell me how to solve the "incomplete convergence of FOK application" problem?
 
anatolev:
I couldn't find it on the forum, maybe someone will tell me how to solve the problem with the "incomplete FOK order".

Good afternoon!

Do you think everyone here is clairvoyant?

How can I tell you anything? There is no MT4 or MT5 terminal,

No code that you use when sending an order and no FORTS or FOREX market!

 
Mikalas:

Good afternoon!

Do you think everyone here is clairvoyant?

How can I tell you anything? There is no MT4 or MT5 terminal,

No code which you use when sending an order, no FORTS or FOREX market!

Forts, and the terminal respectively the 5th EA code is generated by wizard, simple averages


 
anatolev:

Where is the code?

How do you send the order?

P/S The code is inserted by pressing the SRC button

 
Mikalas:

Where is the code?

How do you send the order?

P/S The code is inserted by pressing the SRC button

//+------------------------------------------------------------------+
//|                                                   CrossMA(3).mq5 |
//|                                                             stas |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "stas"
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Include                                                          |
//+------------------------------------------------------------------+
#include <Expert\Expert.mqh>
//--- available signals
#include <Expert\MyFirstSignal\Ma_Cross.mqh>
//--- available trailing
#include <Expert\Trailing\TrailingNone.mqh>
//--- available money management
#include <Expert\Money\MoneyFixedLot.mqh>
//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
//--- inputs for expert
input string         Expert_Title             ="CrossMA(SI)"; // Document name
ulong                Expert_MagicNumber       =13607;        // 
bool                 Expert_EveryTick         =false;        // 
//--- inputs for main signal
input int            Signal_ThresholdOpen     =11;           // Signal threshold value to open [0...100]
input int            Signal_ThresholdClose    =10;           // Signal threshold value to close [0...100]
input double         Signal_PriceLevel        =4.0;          // Price level to execute a deal
input double         Signal_StopLevel         =300.0;         // Stop Loss level (in points)
input double         Signal_TakeLevel         =1000.0;         // Take Profit level (in points)
input int            Signal_Expiration        =4.0;            // Expiration of pending orders (in bars)
input int            Signal_MaCross_FastPeriod=8;           // My_MA_Cross(13,MODE_SMA,21,...) Period of fast MA
input ENUM_MA_METHOD Signal_MaCross_FastMethod=MODE_SMA;     // My_MA_Cross(13,MODE_SMA,21,...) Method of fast MA
input int            Signal_MaCross_SlowPeriod=21;           // My_MA_Cross(13,MODE_SMA,21,...) Period of slow MA
input ENUM_MA_METHOD Signal_MaCross_SlowMethod=MODE_SMA;     // My_MA_Cross(13,MODE_SMA,21,...) Method of slow MA
input double         Signal_MaCross_Weight    =1.0;          // My_MA_Cross(13,MODE_SMA,21,...) Weight [0...1.0]
//--- inputs for money
input double         Money_FixLot_Percent     =0.0;          // Percent
input double         Money_FixLot_Lots        =1.0;          // Fixed volume
//+------------------------------------------------------------------+
//| Global expert object                                             |
//+------------------------------------------------------------------+
CExpert ExtExpert;
//+------------------------------------------------------------------+
//| Initialization function of the expert                            |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- Initializing expert
if(!ExtExpert.Init(Symbol(),Period(),Expert_EveryTick,Expert_MagicNumber))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing expert");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Creating signal
   CExpertSignal *signal=new CExpertSignal;
   if(signal==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating signal");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//---
   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 MA_Cross
MA_Cross *filter0=new MA_Cross;
if(filter0==NULL)
  {
   //--- failed
   printf(__FUNCTION__+": error creating filter0");
   ExtExpert.Deinit();
   return(INIT_FAILED);
  }
signal.AddFilter(filter0);
//--- Set filter parameters
filter0.FastPeriod(Signal_MaCross_FastPeriod);
filter0.FastMethod(Signal_MaCross_FastMethod);
filter0.SlowPeriod(Signal_MaCross_SlowPeriod);
filter0.SlowMethod(Signal_MaCross_SlowMethod);
filter0.Weight(Signal_MaCross_Weight);
//--- Creation of trailing object
  CTrailingNone *trailing=new CTrailingNone;
   if(trailing==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating trailing");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Add trailing to expert (will be deleted automatically))
   if(!ExtExpert.InitTrailing(trailing))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing trailing");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Set trailing parameters
//--- Creation of money object
CMoneyFixedLot *money=new CMoneyFixedLot;
   if(money==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating money");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Add money to expert (will be deleted automatically))
   if(!ExtExpert.InitMoney(money))
     {
      //--- failed
      printf(__FUNCTION__+": error initializing money");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Set money parameters
money.Percent(Money_FixLot_Percent);
money.Lots(Money_FixLot_Lots);
//--- Check all trading objects parameters
   if(!ExtExpert.ValidationSettings())
     {
      //--- failed
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- Tuning of all necessary indicators
   if(!ExtExpert.InitIndicators())
     {
      //--- failed
      printf(__FUNCTION__+": error initializing indicators");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
//--- ok
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Deinitialization function of the expert                          |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   ExtExpert.Deinit();
  }
//+------------------------------------------------------------------+
//| "Tick" event handler function                                    |
//+------------------------------------------------------------------+
void OnTick()
  {
   ExtExpert.OnTick();
  }
//+------------------------------------------------------------------+
//| "Trade" event handler function                                   |
//+------------------------------------------------------------------+
void OnTrade()
  {
   ExtExpert.OnTrade();
  }
//+------------------------------------------------------------------+
//| "Timer" event handler function                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
   ExtExpert.OnTimer();
  }
//+------------------------------------------------------------------+
Here's the code, like this
 
The problem is on and off, only now I've reduced the working timeframe as a test (so that it would signal more often), and when the conditions coincide, it pours.
 
anatolev:
The problem is, then it is not, just now as a test reduced the working timeframe (so that it would signal more often), and when the conditions coincide, poured.

You have a problem with expiry:

input int            Signal_Expiration        =4.0;            // Expiration of pending orders (in bars)

There can not be expiry in BARs, only datetime

 
Mikalas:

You have a problem with expiry:

There can be no expiry in BARs, only datetime

Got it, thanks! And as in this case would be correct, or this line can be excluded? Or maybe it can be set equal to zero, now I have experienced:) achieved that opens the marker at the opening of the second bar after the signal, put
input double         Signal_PriceLevel        =0.0;          // Price level to execute a deal
it was 4. I guess I should correctly say the limit was set 4 ticks better than the market when I had 4, now it works like the market when I set zero.
 
anatolev:
I got it, thank you! If I wanted to place a marker on the opening of the second bar after the signal, I set it to zero, before it was 4. Do I understand correctly, when I had 4, the limit was set to 4 ticks better than the market, and now when I set zero, it works like the market does?

Sorry, but all standard libraries are "tuned" to work on FOREX.

I, and many others, do not use them to work on FOREX.

Unfortunately, I cannot help you in using the standard libraries.

 

Since you obviously know more about automated trading with MT than I do, maybe you can answer a few questions at once.

1) Example: My robot opened a position and moved it to the next trading day. Since the market is closed at night, I close the computer for the night and turn it on in the morning before trading, the question is: will the robot see the position opened earlier after rebooting the computer and the terminal and will it continue working on the position, turning, trailing, etc.?

if so, how does it do this, through the MagicNumber or otherwise?

2) If a trade is opened by the Expert Advisor from one computer, and then another computer with the same Expert Advisor is started, will it continue the work started by the first one or just start trading "from scratch"?