Page 1 of 2 12 LastLast
Results 1 to 10 of 13
 4 Attachment(s)    

Thread: Nameless EA

  1. #1

    Default Nameless EA

    Hi Funyoo!

    First of all, my sincere congratulations for your excellent work! (very professional and fast).

    This is my 1st post at elite section and I apologize if you consider this one a silly idea, but I saw this strategy in some forex forum. I've tested it manually and it seems to work with fair success (mainly Eur/Usd with longer TF's):

    Initial entry:
    -Go long if current price is greater than the close of "X" bars ago
    -Go short if current price is less than the close of "X" bars ago

    Stop loss:
    -If long position is open, close position if current price is less than the close of "X" bars ago.
    -If short position is open, close position is current price is greater than the close of "X" bars ago.

    Next entry:
    -If long position was stopped, go short, when the current price is less than the close of the stopped bar.
    -If short position was stopped, go long, when the current price is greater than the close of the stopped bar.


    Thank you very much


    Regards,

    Lordvader
    Last edited by Lordvader; 10-19-2009 at 01:01.

  2. #2
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Hi lordvader,

    Here is the Nameless EA.
    Attached Files Attached Files

  3. #3

    Default

    Quote Originally Posted by funyoo View Post
    Hi lordvader,

    Here is the Nameless EA.


    Thank you very much for your kind help

    Cheers!

    Lordvader

  4. #4

    Default

    Quote Originally Posted by funyoo View Post
    Hi lordvader,

    Here is the Nameless EA.

    Hi Funyoo,

    I'm very sorry to disturb you again, but the EA is buying and selling almost all the time, and I can't understand the reason why. Maybe I've set the wrong parameters or I've couldn't make myself clear...

    I've sent you my printscreen so you could understand my point:

    I Should only be stopped (my short position) if the entry price exceeds the close of the 10th bar ago, meaning, when my new bar is n+1, my new SL is previous 10th+1. It's almost like a trailing stop based on the current previous 10th bar close.

    I hope you could understand the strategy.

    Regards,

    Lordvader


    The logic is the same (inverted)
    Attached Images Attached Images Nameless EA-untitled-jpg 

  5. #5
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by Lordvader View Post
    Hi Funyoo,

    I'm very sorry to disturb you again, but the EA is buying and selling almost all the time, and I can't understand the reason why. Maybe I've set the wrong parameters or I've couldn't make myself clear...

    I've sent you my printscreen so you could understand my point:

    I Should only be stopped (my short position) if the entry price exceeds the close of the 10th bar ago, meaning, when my new bar is n+1, my new SL is previous 10th+1. It's almost like a trailing stop based on the current previous 10th bar close.

    I hope you could understand the strategy.

    Regards,

    Lordvader


    The logic is the same (inverted)
    Hi Lordvader,

    If you want only one order at a time, set maxtrades on 1.

  6. #6

    Default

    Quote Originally Posted by funyoo View Post
    Hi Lordvader,

    If you want only one order at a time, set maxtrades on 1.
    Funyoo,

    Thanks for the tip (but it's not the problem... I think), as you can observe in the attached jpeg, after the 1st short entry, the EA shouldn't enter no more (short and/or long) positions because I have no defined TP, and SL wasn't reached.
    This way, my SL is also my TP and I should still be short.

    Regards,

    Lordvader

  7. #7
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by Lordvader View Post
    Funyoo,

    Thanks for the tip (but it's not the problem... I think), as you can observe in the attached jpeg, after the 1st short entry, the EA shouldn't enter no more (short and/or long) positions because I have no defined TP, and SL wasn't reached.
    This way, my SL is also my TP and I should still be short.

    Regards,

    Lordvader
    I don't understand.

    On the third sell order, the price goes over the close of 10th last bar, and by consequent close the sell orders. Then as we are over the close of the 10th last bar, we go long, etc... the virtual stoploss is updated after each bar.

  8. #8

    Default

    Quote Originally Posted by funyoo View Post
    I don't understand.

    On the third sell order, the price goes over the close of 10th last bar, and by consequent close the sell orders. Then as we are over the close of the 10th last bar, we go long, etc... the virtual stoploss is updated after each bar.
    Hi Funyoo,

    I'm very sorry: that was a wrong interpretation (of mine) of the strategy, the SL is a fixed one, meaning, we entered short and SL is always the close of 10th bar ago, and then we set the parameters for a trailing stop.
    Could you modify it, please?

    Best regards,

    Lordvader

  9. #9
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by Lordvader View Post
    Hi Funyoo,

    I'm very sorry: that was a wrong interpretation (of mine) of the strategy, the SL is a fixed one, meaning, we entered short and SL is always the close of 10th bar ago, and then we set the parameters for a trailing stop.
    Could you modify it, please?

    Best regards,

    Lordvader
    Hi Lordvader,

    I didn't notice "Initial Entry", "Next Entry".

    What happen after "Next Entry" ? For the moment, the next entry rule is indefinitely repeated.

    Here is the modified code. It took me a while, as i didn't know how to determine the close of the bar of the last order close time.

    Note that when the distance between the price and the close of the 10th last bar is under stoplevel (15 pips) at the beginning, the EA will not be able to enter a stop loss.
    Attached Files Attached Files

  10. #10

    Default

    Quote Originally Posted by funyoo View Post
    Hi Lordvader,

    I didn't notice "Initial Entry", "Next Entry".

    What happen after "Next Entry" ? For the moment, the next entry rule is indefinitely repeated.

    Here is the modified code. It took me a while, as i didn't know how to determine the close of the bar of the last order close time.

    Note that when the distance between the price and the close of the 10th last bar is under stoplevel (15 pips) at the beginning, the EA will not be able to enter a stop loss.

    Hi Funyoo,

    Please let me simplify (excuse my poor English):

    First entry (When EA starts to trade):

    -Go long if current price is greater than close of 10th bar ago.
    (our stop loss is permanent for this entry and it's the close of that 10th bar, our TP is configured in EA parameters with a trailing stop)

    --Go short if current price is less than close of 10th bar ago.
    (our stop loss is permanent for this entry and it's the close of that 10th bar, our TP is configured in EA parameters with a trailing stop)


    If stopped (when Long or Short), use same logic (loop) within the next bar.

    That's it!

    BTW: if we use negative xbarsago, what would be the logic?


    Best regards,

    Lordvader
    Last edited by Lordvader; 10-20-2009 at 00:03.

Tags for this Thread

elite, eur, eur/usd, forex, funyoo, how to, stop, stoploss, strategy, time, trailing, usd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •