Even if it is meant for the Strategy Tester, if it is capable of placing trades, then it is not an Indicator, it is an Expert Advisor. Indicators can't trade.
You are already a "seller" and have market products, so you already know how to sell it.
You can sell your EA, classified as an "Utility", for which there are already several such utilities to "trade" in the Strategy Tester, some of which are free.
You can detect at run-time what license type is being used ...
Identifier
Description
LICENSE_FREE
A free unlimited version
LICENSE_DEMO
A trial version of a paid product from the Market. It works only in the strategy tester
LICENSE_FULL
A purchased licensed version allows at least 5 activations. The number of activations is specified by seller. Seller may increase the allowed number of activations
LICENSE_TIME
A version with a limited term license
Maybe you can adjust the functionality depending on whether it is a "purchased" product or a "trial" product.
However, this may violate a Market rule, so please check with the Service Desk, if this is acceptable.
- www.mql5.com
As you said, Fernando, I asked the Service Desk for permissions. In the meantime I wrote this line to limit the demo and free versions. Do you reckon it could work?
int OnInit() { if (MQLInfoInteger(MQL_TESTER)) { time_frame=0; ENUM_LICENSE_TYPE mql_program=(ENUM_LICENSE_TYPE)MQLInfoInteger(MQL_LICENSE_TYPE); switch(mql_program) { case LICENSE_DEMO: { if( TimeCurrent() > StringToTime("2023.08.01 00:00:00") && TimeCurrent() < StringToTime("2023.08.31 00:00:00")) {time_frame=1;}; break; } case LICENSE_FREE: { if( TimeCurrent() > StringToTime("2023.08.01 00:00:00") && TimeCurrent() < StringToTime("2023.08.31 00:00:00")) {time_frame=1;}; break; } case LICENSE_FULL: { time_frame=2; break; } } if(time_frame == 0) { ChartSetInteger(0, CHART_COLOR_BACKGROUND, clrBlack); ChartSetInteger(0, CHART_COLOR_FOREGROUND, clrBlack); ChartSetInteger(0, CHART_COLOR_ASK, clrBlack); ChartSetInteger(0, CHART_COLOR_BID, clrBlack); ChartSetInteger(0, CHART_COLOR_CANDLE_BEAR, clrBlack); ChartSetInteger(0, CHART_COLOR_CANDLE_BULL, clrBlack); ChartSetInteger(0, CHART_COLOR_CHART_LINE, clrBlack); ChartSetInteger(0, CHART_COLOR_CHART_UP, clrBlack); ChartSetInteger(0, CHART_COLOR_CHART_DOWN, clrBlack); ChartSetInteger(0, CHART_SHOW_GRID, false); ChartSetInteger(0, CHART_SHOW_ASK_LINE, false); ChartSetInteger(0, CHART_SHOW_BID_LINE, false); ChartSetInteger(0, CHART_SHOW_VOLUMES, false); ObjectSetInteger(0,"Label_license1",OBJPROP_BACK,false); ObjectCreate(_Symbol,"Label_license1",OBJ_LABEL,0,0,0); ObjectSetInteger(0,"Label_license1", OBJPROP_XDISTANCE,20); ObjectSetInteger(0,"Label_license1", OBJPROP_YDISTANCE,100); ObjectSetInteger(0,"Label_license1", OBJPROP_FONTSIZE,72); ObjectSetInteger(0,"Label_license1", OBJPROP_COLOR, clrWhite); ObjectSetString(0,"Label_license1",OBJPROP_TEXT,"Sorry, the demo version"); ObjectSetInteger(0,"Label_license2",OBJPROP_BACK,false); ObjectCreate(_Symbol,"Label_license2",OBJ_LABEL,0,0,0); ObjectSetInteger(0,"Label_license2", OBJPROP_XDISTANCE,20); ObjectSetInteger(0,"Label_license2", OBJPROP_YDISTANCE,180); ObjectSetInteger(0,"Label_license2", OBJPROP_FONTSIZE,72); ObjectSetInteger(0,"Label_license2", OBJPROP_COLOR, clrWhite); ObjectSetString(0,"Label_license2",OBJPROP_TEXT,"works only between"); ObjectSetInteger(0,"Label_license3",OBJPROP_BACK,false); ObjectCreate(_Symbol,"Label_license3",OBJ_LABEL,0,0,0); ObjectSetInteger(0,"Label_license3", OBJPROP_XDISTANCE,20); ObjectSetInteger(0,"Label_license3", OBJPROP_YDISTANCE,260); ObjectSetInteger(0,"Label_license3", OBJPROP_FONTSIZE,72); ObjectSetInteger(0,"Label_license3", OBJPROP_COLOR, clrWhite); ObjectSetString(0,"Label_license3",OBJPROP_TEXT,"2023.08.01 00:00:00"); ObjectSetInteger(0,"Label_license4",OBJPROP_BACK,false); ObjectCreate(_Symbol,"Label_license4",OBJ_LABEL,0,0,0); ObjectSetInteger(0,"Label_license4", OBJPROP_XDISTANCE,20); ObjectSetInteger(0,"Label_license4", OBJPROP_YDISTANCE,340); ObjectSetInteger(0,"Label_license4", OBJPROP_FONTSIZE,72); ObjectSetInteger(0,"Label_license4", OBJPROP_COLOR, clrWhite); ObjectSetString(0,"Label_license4",OBJPROP_TEXT,"to 2023.08.31 00:00:00."); } }
and in OnCalculate
int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[]) { if (MQLInfoInteger(MQL_TESTER)) { if(time_frame == 0) { Print("Out of time frame! "+TimeCurrent()); color clr_labels="clrNONE"; color clr_buy_label="clrNONE"; color clr_sell_label="clrNONE"; color clr_lossLine="clrNONE"; ObjectSetInteger(0,"Label_trade", OBJPROP_COLOR, clr_labels); ObjectSetInteger(0,"Label_stop_loss", OBJPROP_COLOR, clr_labels); ObjectSetInteger(0,"Label_pips", OBJPROP_COLOR, clr_labels); ObjectSetInteger(0,"Label_spread", OBJPROP_COLOR, clr_labels); ObjectSetInteger(0,"Label_total", OBJPROP_COLOR, clr_labels); ObjectSetInteger(0,"Label_speed", OBJPROP_COLOR, clr_labels); ObjectSetInteger(0,"Sell_loss_line",OBJPROP_COLOR,clr_lossLine); ObjectSetInteger(0,"Buy_loss_line",OBJPROP_COLOR,clr_lossLine); ObjectSetInteger(0,"Sell_loss_line",OBJPROP_COLOR,clr_lossLine); ObjectSetInteger(0,"Buy_loss_line",OBJPROP_COLOR,clr_lossLine); ChartSetInteger(0, CHART_COLOR_BACKGROUND, clrBlack); ChartSetInteger(0, CHART_COLOR_FOREGROUND, clrBlack); ChartSetInteger(0, CHART_COLOR_ASK, clrNONE); ChartSetInteger(0, CHART_COLOR_BID, clrNONE); ChartSetInteger(0, CHART_COLOR_CANDLE_BEAR, clrNONE); ChartSetInteger(0, CHART_COLOR_CANDLE_BULL, clrNONE); ChartSetInteger(0, CHART_COLOR_CHART_LINE, clrNONE); ChartSetInteger(0, CHART_COLOR_CHART_UP, clrNONE); ChartSetInteger(0, CHART_COLOR_CHART_DOWN, clrNONE); ChartSetInteger(0, CHART_SHOW_GRID, false); ChartSetInteger(0, CHART_SHOW_ASK_LINE, false); ChartSetInteger(0, CHART_SHOW_BID_LINE, false); ChartSetInteger(0, CHART_SHOW_VOLUMES, false); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everybody. I developed an indicator to practice manuial trading on the strategy tester. it let the user do trading at a faster speed, thanks to the strategy tester use, buying, selling, placing the stop loss and administering a little capital in terms of pips. The problem is, being an indicator for the strategy tester there is no limit to use it. How can I sell it? Thanks