Need i_Trend expert for MT4

 

Well I never really learned MT4 and don't have to work on it right now.

This is open to anyone, since it's really basic and extremely customizable...

Indicator : i_Trend

Variables : x; y (y is for takeprofit value); z (z is for stop loss); any other variables to control the i_Trend

So i_Trend has two values, Value1 and Value2. When Value1 is over Value2 that means its a buy, and if Value2 is over Value1 then its a sell.

What I would like to program is simplified like this:
If Value1-Value2>x then Buy and set take profit at value of y
If no other trades open then continue
If Value2-Value1>x then Sell and set take profit at value of y

[Note: I don't really want any delay, I noticed if tested well enough its ok if the expert acts directly, otherwise it might be too late and hit the stop loss too many times. In other words, do not wait until next candle to open or close a trade, just open it right when then tick appears]

If Buy position open and Value1<Value2 then Close
If Sell position open and Value1>Value2 then Close


For those who are curious I am thinking of using this for smaller timeframes, with a small amount of takeprofit. I don't think a trailing stop is very necessary. I am aiming for the small but multiple profits making a few pips at a time.

Attached is the custom indicator i_Trend

Thanks in advance and hope this is a good one

Files:
i_Trend.mq4  4 kb
 

Just coded the expert for you. Check it out in forward testing, see if it opens trade if the green line crosses red line or not.

Features:

  • Supports multiple timeframe + multiple pairs.
  • Trailing stop.
  • New crossover-checking method.

Enjoys!

Files:
 

Thanks scorpion!

I'll wait for sunday night my time to check it, otherwise I don't know if InterbanFX is going to be open because its Martin Luther King Jr. day here.

I'll be sure to test it right when I can and post my best results whenever possible, thanks alot!!

 

Hey scorpion,

So i was looking at the expert. I understand most of the Inputs but I'd like to know exactly what they are. So:

-the Evaluate Interval.. What exactly does this mean? is it -1 for instant cross, 0 for the candle after the cross and so on? Let me know if im right...

-TS Sensitivity, Mode and Dynamic Factor, How exactly do those work? I am guessing the Mode works with a 1, 2 maybe 3 but I dont know what they do, maybe i dont need to touch them. The dynamic factor is that when the x and y factors that I was talking about in the first post?

let me know whenever possible, take your time as I am in no rush

 

Here's you go gaz:

Settings:

  • Evaluate_Interval: Interval in minutes between each evaluation. This limit the number of trades in the same candle. Example, if set to 30, then there will be no more than 1 trade in 30 minutes. If -1, expert will evaluate logics on new candle (1 trade/candle). If 0, expert will evaluate logics every ticks (not recommended). If greater than 0, expert will evaluate every specified minutes.
    • TS_Trigger: Minimum distance in pips before initiate trailingstop.
      • TS_Mode and TS_Factor:
        • For buy order, when price rises:
        • Mode 2. ATR: SL is moved accordingly to current Low price - (ATR14 * TS_Factor)Mode 3. Half Volatility: SL is moved accordingly to current Low - (High + Low)*TS_Factor

        • For sell order, when price falls:
        • Mode 2. ATR: SL is moved accordingly to current High + (ATR14 * Factor)Mode 3. Half Volatility: SL is moved accordingly to current High + (High + Low)*Factor

      • TS_Sensitivity: Sensitivity of trailingstop. E.g. If set to 5, then SL is trailed every 5 pips move. It's not recommend to set TS_Sensitivity to 1, because mt4 cannot handle SL modification requests every pip move.
      •  

        Scorpion,

        I'm sorry to ask again, this helped me but where exactly do I set the x's and y's like I explained? What are these all based on? just crosses or on the

        value1-value2 and value2-value1?

        I think from what I've seen this is just based on crosses of iTrend but i want to avoid that by using the substraction method. Otherwise the iTrend will make many useless trades that will fail the expert.

        Please let me know,

        Thanks

         

        I see. You just want an additional value-based filter.

        Gaz, you should check Evaluate_Interval out. It also limits the number of trade and false crosses.

        Files:
         

        Hey scorpion,

        this is going nicely, the onyl problem right now is ont he InterbankFX's side, its been disconnecting alot. I turned it on this morning, made 10 pips and lose 1 so basically ended up with 9 pips profit. I'm not quite sure if it followed any of the Trailing Stop or Stop Loss because I changed it in the expert after the trade opened.

        I'll try to test it soon, but this disconnection is bugging me, Its the second time today and I read in the yahoo groups that its been doing that lately.

        Hopefully InterbankFX will fix that otherwise I doubt I will be a future customer

         

        Well for some reason the expert is actually predicting the future? It's making sell trades before the itrend makes a cross. The indicator and the expert are on the same settings so i'm not sure what is going on. I missed a big move as well (whether it be big or small i have a 5pip take profit anyways) when my connection was lost...

        I can't find any InterbankFX servers either so I can't find out if this is being worked on already

         

        Hey scorpion,

        I was just wondering does the take profit and trailing stop include the spread? For example if I put 3 pips as a take profit and the InterbankFX spread is 2 does this mean after 5 pips it will close the trade or at 3?

        Thanks

         

        TP and SL do include spread. TP = 100 simply means that you get 100 net pips profit regardless how much spread it is. SL is the same.

        gazuz:
        For example if I put 3 pips as a take profit and the InterbankFX spread is 2 does this mean after 5 pips it will close the trade or at 3?

        TP will be hit at 5 pips.

        Reason: