Forum

Code for lot size calculations not working

Hi, I have written a script below to determine the lot size of an order based upon the stoploss size. I am using mt4 pepperstone using the standard demo account (leverage 500, if that matters). However, I get the same lot size, irrespective of the stoploss value. Can someone tell me what I am doing

Not sure what function to use to get bar info relative to an opened order

I want to code a loop to close an order (effectively a stoploss). The order should be closed when the price drops below the lowest price (minus 2 pips) of either of the 3 bars immediately before the marker buy order. I was thinking of using the CopyLow to get a history of the lowest price of an

Need help coding a limit criteria

Hi, I'm trying to code for a limit criteria to close an order, however the criteria needs only to be relevant when the 4th bars appears following a marker order. I would like to code to assess the characteristics of all bars (already have coded this), subsequent to the 4th bar of an order. I am

EA won't open a trade

Hi MQL community Admittedly I am new to coding but have written a few successful codes but I am having trouble with this simple eaI am trying to write. The ea will open a buy order when a spinning to candle appears and this is tied in with an alert. I have written in the code to only allow one open