Errors, bugs, questions - page 2230

 

How can I know without waiting for the trade result of MqlTradeRequest request in OnTradeTransaction when using OrderSend/OrderSendAsync?


This way you can listen only after the trade request is executed.

Forum on trading, automated trading systems and testing trading strategies

Multiple positions

fxsaber, 2018.07.16 15:48

// Repeater

sinput int AmountPositions = 3;
input string OrderComment = "";

void OnTradeTransaction( const MqlTradeTransaction &Trans, const MqlTradeRequest &Request, const MqlTradeResult &Result )
{
  if ((Trans.type == TRADE_TRANSACTION_REQUEST) && (!Request.position) && (Request.comment == OrderComment))
  {
    MqlTradeResult MyResult;
    MqlTradeRequest MyRequest = Request;        
    
    bool Res = true;
    
    for (int i = 1; Res && (i <= AmountPositions); i++)
    {
      MyRequest.comment = Request.comment + "_" + (string)i;;

      Res = OrderSendAsync(MyRequest, MyResult);
    }
  }
}

How to see the PO? I suggest developers fill in Request-structure when Trans.order_state == ORDER_STATE_STARTED. It's the only logical and not crutchy option.

 
For what reason are the comments in the MT4-Signals history cut off? For example, the original comment is "[+3;+3][tp]" but in Signals it shows as "[tp]".
 

Noticed the regular appearance of fake accounts on the forum, under which bots are hiding. The administration/moderators are trying to clean up the forum on a daily basis...

 

I wanted to colour levels in Fibo programmatically

      ObjectSetInteger(0,"FiboLevels",OBJPROP_LEVELCOLOR, 0 ,clrBlack); 
      ObjectSetInteger(0,"FiboLevels",OBJPROP_LEVELCOLOR, 1, clrRed); 
      ObjectSetInteger(0,"FiboLevels",OBJPROP_LEVELCOLOR, 2, clrGreen); 

I understood in the help that you can set a colour for each level...

But it didn't work... The example in the help should be able to change colour, but it doesn't work...

 
Vladimir Pastushak:

I wanted to colour levels in Fibo programmatically

I understood in the help that you can set a colour for each level...

But it didn't work... The example in the help should be able to change colour, but it doesn't work...

You can't set a different colour for each level.

 
Vladimir Pastushak:

I wanted to colour levels in Fibo programmatically

I understood in the help that you can set a colour for each level...

But it didn't work... The example in the help should be able to change colour, but it doesn't work...

It works for me.

   ObjectSetInteger(ChartID(), "FiboLevels", OBJPROP_LEVELCOLOR, 0, clrBlack);
   ObjectSetInteger(ChartID(), "FiboLevels", OBJPROP_LEVELCOLOR, 2, clrGreen);
   ObjectSetInteger(ChartID(), "FiboLevels", OBJPROP_LEVELCOLOR, 4, clrYellow);
 
Alexey Kozitsyn:

You can't give each level a different colour.

Why not?

 
Alexey Viktorov:

Why?

From personal experience... Tried it that way at one time - didn't work, maybe something was fixed or I was doing something wrong.

Added:

Yes indeed, it is possible to colour the levels. Here is the script (settings for EURUSD):

#property version   "1.00"
#property script_show_inputs
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
sinput   datetime inpT1=    D'2018.07.19 13:27';
sinput   double   inpP1=   1.16136;
sinput   datetime inpT2=    D'2018.07.19 15:31';
sinput   double   inpP2=   1.15746;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   const string name="FiboTest";
//---
   if(ObjectCreate(0,name,OBJ_FIBO,0,inpT1,inpP1,inpT2,inpP2))
     {
      ObjectSetInteger(0,name,OBJPROP_SELECTABLE,true);
      ObjectSetInteger(0,name,OBJPROP_LEVELS,6);
      //---
      ObjectSetInteger(0,name,OBJPROP_LEVELCOLOR,0,clrYellow);
      ObjectSetInteger(0,name,OBJPROP_LEVELCOLOR,1,clrRed);
      ObjectSetInteger(0,name,OBJPROP_LEVELCOLOR,2,clrLime);
     }
  }
//+------------------------------------------------------------------+

Only there's a catch. If I go to the object properties afterwards and exit - the levels will be colored in one colour:) Yet there are some lags with this coloring. Build 1881, x64.

 

Problem in the marketplace:

When replying to messages in the Discussion section, or adding a new reply, a blank page appears:

Whereas if you copy the link after the reply, the same blank page appears.

But if you click on the DISCLOSURE tab, then the page with the same link appears (I've compared) and everything is fine.

 

There's a problem in the marketplace from a mobile phone:

If you go from your mobile phone (any phone) to your profile - seller - stats, the stats hangs up and the site is inaccessible for about 5 minutes.

Nothing happens, no data is displayed.

The status bar freezes.

This is only in the Seller - Statistics section