Forum

Recording the Moving Average value at OrderOpenTime

Hi I would like to be able to capture the Moving average value at the time of Order . I was using ibarshift to convert OrderOpenTime to a bar value to use in iMA, but I have noticed that the MA value continues to calculate until the bar of the timeframe selected closes. Is there a way to prevent

Integrating Zigzag directly into EA code - MT4

Hi My EA has used the icustom function to bring in the ZigZag values that i need. However the optimization testing takes forever. In an attempt to speed the optimisation up, I believe the EA may work quicker if I integrate the Zigzag indicator into my EA directly. (I hope that is accurate) to that

ZigZag indicator to work in Optimization

Hi When the ZigZag indicator was "fixed" from v600, it effectively made it difficult to use this indicator in an EA with strategy Tester and optimization, unless you isolate Backstep and don't include this in the optimization. I use Zigzag in my Ea using icustom to call it. And therefore when

ECN Brokers still need OrderModify for SL?

Hi, Recently started looking at my EA's after a few years break and struggling a little with some of my code. When I switched from using a Standard account to an ECN broker I remember having to add extra code into my Market Order process, where I needed to place the Market order and then Modify the

Count bars since price reach a certain point

Hi Am i supposed to now be posting this in the mql5 forum? (not very clear as there doesn't seem to be a dedicated mt4 section) I have tried to write a function that will count the number of bars when a certain criteria is met. In this case when price may have crossed above/below the 61fib line. I

Consecutive higher highs / lower lows determined by input variable

Hi I am trying to create a signal where the entry bar must appear after a certain number of higher highs or lower lows. eg like an outside bar / inside bar / pin bar. So affectively i want a check to make sure the bar is in a good "location" ie top or bottom of a swing for example. I tried to

Resetting an indicator with a bool variable

Hi I am trying to turn part of an indicator into an EA. At the moment i just want to see the the basic logic working before i add to it, but i can't seem to get the switch correct to reset the indicator. I just want to see the date/time printed for each bullish pin or bearish pin. I was trying to

Invalid array access

Hi I am getting an error message - IgnoreArray - invalid array access - on this .mqh file, when trying to compile it. Is it possibly related to the changes that came with v600?I can't seem to find enough info on the eror message to help me work out what the problem is. I am hoping to use this code

how to use this trend line indicator as a trade filter

Hi I would like to add this indicator as a filter for trading - simply if trendline is blue then long positions, if red then short positions. I am used to using icustom to bring in the indicator values to my EA so that i can use them, but I am not sure how i would do it in this case. I have tried

Money management - Dynamic lotsize based on risk compared to margin utilising a martingalesque technique

Hi The Martingale part: I basically want to be able to increase the percentage of equity/account balance risked if the last trade was profitable. Keep increasing the percentage by 1% to a max of 10%. I have managed to code this. In testing the first issue came as I then ran out of margin as soon as