Scripts: Pending orders DOWN - page 2

 
Vladimir Karputov:

The input parameter - position volume - has been set for the future: when several modernisation proposals are collected, then it will be included in the stake. For now, the script puts pending orders with the minimum possible volume.

So it's an obvious desire, why wait for several proposals, when you can do it right away so that the script was as flexible as possible ... This is a rhetorical question...

Then I will ask you to help with the last one: down - down from the sell price? up - up from the buy price? And what can cause the order not to be placed? I have all the settings set, but no order is placed....

Thank you very much for your help!

 
KentR:

So it's an obvious desire, why wait for a few suggestions when you can do it right away so that the script is as flexible as possible... It's a rhetorical question...

Then I will ask you to help with the last one: down - down from the sell price? up - up from the buy price? And what can cause the order not to be placed? All the settings are set, but the order is not placed....

Thank you very much for your help!

Check the "Journal" tab in the terminal - there will be an error there, if there was an erroneous trade operation.

 

Checked... It seems that now the value value in the first field is too big and I need decimal places.... Is it possible?

 
Let me repeat the text: after changing the value of the first cell, its effect on the price has changed and I now need fractional values less than 1... I understand that the current problem is because of this
 
KentR:

Checked... It looks like now the value in the first field is too big and I need decimal places.... Is this possible?

The script has nothing to do with it. The answer is marked with an "error" icon on your screenshot. In general, trade on another symbol.

 

Hello Sir,

Can it be modified by adding martingale lot size?

Example 1st order lot size 0.1

              2nd order lot size 0.11

              3rd order lot size 0.12

              etc


Thank you

 
LOTS cannot be changed, it is always 0.01 lots.
 
keenans :
LOTS could not be changed, it was always 0.01 lots.

The statement is incorrect.

That's right: the volume is always equal to the minimum volume.

 

The volume is always equal to the minimum volume. Look at the code:

//--- pending orders DOWN
   for(int i=0;i<InpDownQuantity;i++)
     {
      double price_ask     = start_price_ask-i*ExtDownStep;
      double price_bid     = start_price_bid-i*ExtDownStep;
      if(InpDownOrders==buy_limit)
        {
         double sl         = (ExtStopLoss==0.0)   ? 0.0 : price_ask - ExtStopLoss;
         double tp         = (ExtTakeProfit==0.0) ? 0.0 : price_ask + ExtTakeProfit;
         m_trade.BuyLimit(m_symbol.LotsMin(),m_symbol.NormalizePrice(price_ask),m_symbol.Name(),
                          m_symbol.NormalizePrice(sl),
                          m_symbol.NormalizePrice(tp));
        }
      else
        {
         double sl         = (ExtStopLoss==0.0)   ? 0.0 : price_bid + ExtStopLoss;
         double tp         = (ExtTakeProfit==0.0) ? 0.0 : price_bid - ExtTakeProfit;
         m_trade.SellStop(m_symbol.LotsMin(),m_symbol.NormalizePrice(price_bid),m_symbol.Name(),
                          m_symbol.NormalizePrice(sl),
                          m_symbol.NormalizePrice(tp));
        }
     }
 

Hello, the script is really great and the only one on MQ5, but I would like to have in my arsenal the same, but with a lot, say 1 or 0.5.

Thank you for your labours and happy holidays.