Using iCustom against an indicator with a password

 

Hi,

I am trying to use the buy and sell indicators from a purchased indicator with a password using iCustom. I have tried using the code below in the strategy tester with the response in the journal of "Your License is invalid". Putting the license in the first spot after the name of the called indicator did not work nor leaving the license field out. Any help would be appropriate.

I tried          if(iCustom(NULL,0,"ATS",License,5,0)!=EMPTY_VALUE)

as well as      if(iCustom(NULL,0,"ATS",5,0)!=EMPTY_VALUE)




//+------------------------------------------------------------------+

//|                                                     Working.mq4  |

//+------------------------------------------------------------------+

#property version   "1.0"

#property strict

#include <stderror.mqh>

#include <stdlib.mqh>

enum TrailType{Regular,CandleTrail};



//--- input parameters

extern double StopLoss=25;

extern double TakeProfit=50;

input double   LotSize=1;

extern int MaxAmountOfTrades=1;

extern bool HedgingAllowed=false;

extern string License="QPSPUQTU-NRQMKOPZ-OJMLMVO["; //Dot Expansion License



//Moving Average Settings.

extern int FastMA=7;

extern int FastMaShift=0;

extern int FastMaMethod=1;

extern int FastMaAppliedTo=0;

extern int SlowMA=21;

extern int SlowMaShift=0;

extern int SlowMaMethod=1;

extern int SlowMaAppliedTo=0;



//---

extern int Slippage=30;

extern int MagicSeed=0;

extern int maxspread=5;



double pips;

int magic=0;

//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+

int OnInit()

  {



   pips=Point; //.00001 or .0001. .001 .01.

   if(Digits==3 || Digits==5)

      pips*=10;

   Comment("Expert Loaded Successfully");

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Expert deinitialization function                                 |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {

   Comment(" ");

  }

//+------------------------------------------------------------------+

//| Expert tick function                                             |

//+------------------------------------------------------------------+

void OnTick()

  {

   CheckForSignal();

  }

//+------------------------------------------------------------------+

//|       TRIGGER FUNCTION                                           |

//+------------------------------------------------------------------+

void CheckForSignal()

  {

         if(iCustom(NULL,0,"ATS",License,5,0)!=EMPTY_VALUE)

            EnterTrade(OP_BUY);



         if(iCustom(NULL,0,"ATS",License,6,0)!=EMPTY_VALUE)

            EnterTrade(OP_SELL);

}
The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
The idea of ​​automated trading is appealing by the fact that the trading robot can work non-stop for 24 hours a day, seven days a week. The robot does not get tired, doubtful or scared, it's is totally free from any psychological problems. It is sufficient enough to clearly formalize the trading rules and implement them in the algorithms, and...
Files:
Snip.PNG  49 kb