Experts: Carbophos

 

Carbophos:

The Expert Advisor sets a grid of pending Sell Limit and Buy Limit orders.

Author: Vladimir Karputov

 

Hello. If possible, please provide a variant with BUYSTOP and SELLSTOP

 
alex123456:

Hello. If possible, please provide a variant with BUYSTOP and SELLSTOP


Search on the phrase"buy stop" and on KodoBase:

buy stop

 
alex123456:

Hello. If possible, please present a variant with BUYSTOP and SELLSTOP.


I think it's quite simple, but if it's Barabashka's solution in principle, he can chick me).

      for(int i=0;i<5;i++)
        {
         m_trade.BuyStop(InpLot,m_symbol.Bid()+(double)(i+1)*ExtStep);
         m_trade.SellStop(InpLot,m_symbol.Ask()-(double)(i+1)*ExtStep);
        }

It's in the void OnTick() procedure.

Instead of 5(for(inti=0;i<5;i++)), you can substitute another number of open detectors, or substitute a variable from input.