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

Thread: Fibobars Like EA

  1. #1

    Default Fibobars Like EA

    Funyoo,


    Can you do an EA with all your usual options (including time filtering) with next parameters.
    Record the high and low and also the time of high and low of the last N bars.
    Level external can be a fibo level like 38.2% or any arbitrary level between 0 and 100

    Long position: price > low(Nbars) + (high(Nbars)-low(Nbars))*Level and time(low(Nbars)) > time(high(Nbars)). Practically the price is coming of a regional low and is going higher passing a certain level.
    Short position: reverse of long: price < high(Nbars) - (high(Nbars)-low(Nbars))*Level and time(high(Nbars)) > time(low(Nbars))
    exit positions by reverse signal or by trailing stop.
    Option to enter the position on new bar only if closing of previous bar triggered the signal.

    I hope that my explanation is clear. I try to recreate something like Fibobars that hopefully will not have the problems from fibo and will optimize faster than fibo.

    After testing a lot of variants of Fibobars EA (including Fibobars2 indicator) it looks like the indicator does not pass the signal properly to EA although it changes the color of the bars.

    Thanks a lot Funyoo for the hard work

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

    Default

    Quote Originally Posted by daxc View Post
    Funyoo,


    Can you do an EA with all your usual options (including time filtering) with next parameters.
    Record the high and low and also the time of high and low of the last N bars.
    Level external can be a fibo level like 38.2% or any arbitrary level between 0 and 100

    Long position: price > low(Nbars) + (high(Nbars)-low(Nbars))*Level and time(low(Nbars)) > time(high(Nbars)). Practically the price is coming of a regional low and is going higher passing a certain level.
    Short position: reverse of long: price < high(Nbars) - (high(Nbars)-low(Nbars))*Level and time(high(Nbars)) > time(low(Nbars))
    exit positions by reverse signal or by trailing stop.
    Option to enter the position on new bar only if closing of previous bar triggered the signal.

    I hope that my explanation is clear. I try to recreate something like Fibobars that hopefully will not have the problems from fibo and will optimize faster than fibo.

    After testing a lot of variants of Fibobars EA (including Fibobars2 indicator) it looks like the indicator does not pass the signal properly to EA although it changes the color of the bars.

    Thanks a lot Funyoo for the hard work
    Hi daxc,

    Here is Fibobars Like EA.

    "Option to enter the position on new bar only if closing of previous bar triggered the signal." Set shift=1.
    Attached Files Attached Files

  3. #3

    Default

    Thank you very much for your quick response.
    At first visual testing does not close some trades if the signal is invalidated, although the code looks like is correct. Is there another way to check the open position against the signal?
    I will do more tests and report back ASAP.

    Thanks again Funyoo

  4. #4

    Default

    Can we constantly check the signal versus open position?
    Attached graphic from EU H1 bars=6 shift=2 level=0.2
    Attached Images Attached Images Fibobars Like EA-fibolike-gif 

  5. #5

    Default

    Thanks for comments I spotted a mistake.
    double high=High[iHighest(NULL,0,MODE_HIGH,nbars,shift+1)];
    double low=High[iLowest(NULL,0,MODE_LOW,nbars,shift+1)]; i think should be low=Low[iLowest(NULL,0,MODE_LOW,nbars,shift+1)];
    int timehigh=Time[iHighest(NULL,0,MODE_HIGH,nbars,shift+1)];
    int timelow=Time[iLowest(NULL,0,MODE_LOW,nbars,shift+1)];

    Can you display in comments if signal is long or short?

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

    Default

    Quote Originally Posted by daxc View Post
    Thanks for comments I spotted a mistake.
    double high=High[iHighest(NULL,0,MODE_HIGH,nbars,shift+1)];
    double low=High[iLowest(NULL,0,MODE_LOW,nbars,shift+1)]; i think should be low=Low[iLowest(NULL,0,MODE_LOW,nbars,shift+1)];
    int timehigh=Time[iHighest(NULL,0,MODE_HIGH,nbars,shift+1)];
    int timelow=Time[iLowest(NULL,0,MODE_LOW,nbars,shift+1)];

    Can you display in comments if signal is long or short?
    Hi daxc,

    Right, mistake corrected and signal displayed.
    Attached Files Attached Files

  7. #7

    Default

    Thanks Funyoo for quick reply.

    double high=High[iHighest(NULL,0,MODE_HIGH,nbars,shift+1)];
    double low=Low[iLowest(NULL,0,MODE_LOW,nbars,shift+1)];
    int timehigh=Time[iHighest(NULL,0,MODE_HIGH,nbars,shift+1)];
    int timelow=Time[iLowest(NULL,0,MODE_LOW,nbars,shift+1)];

    even for shift=0 the high and low are at least one bar behind. if the price is making new high or new lows the program is not aware. i think we should check for this and make sure that is a long for new highs as well as a short for new lows.

    in the attached image is a No signal from this morning. i also let a fibobars indicator for visual check. In no circumstances should be a "No Signal". is either a buy or a sell.
    In this instance last time was a low and the price was not above 0.2 level so there should be a sell in efect.
    Parameters for EA and fibobars are: 144 period with fibolevel=1 and level=0.2 on EU M5.
    Thanks again for help
    Attached Images Attached Images Fibobars Like EA-fibolike1-gif 

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

    Default

    Quote Originally Posted by daxc View Post
    Thanks Funyoo for quick reply.

    double high=High[iHighest(NULL,0,MODE_HIGH,nbars,shift+1)];
    double low=Low[iLowest(NULL,0,MODE_LOW,nbars,shift+1)];
    int timehigh=Time[iHighest(NULL,0,MODE_HIGH,nbars,shift+1)];
    int timelow=Time[iLowest(NULL,0,MODE_LOW,nbars,shift+1)];

    even for shift=0 the high and low are at least one bar behind. if the price is making new high or new lows the program is not aware. i think we should check for this and make sure that is a long for new highs as well as a short for new lows.

    in the attached image is a No signal from this morning. i also let a fibobars indicator for visual check. In no circumstances should be a "No Signal". is either a buy or a sell.
    In this instance last time was a low and the price was not above 0.2 level so there should be a sell in efect.
    Parameters for EA and fibobars are: 144 period with fibolevel=1 and level=0.2 on EU M5.
    Thanks again for help
    Hi daxc,

    Ok code updated.
    Attached Files Attached Files

  9. #9

    Default

    Still No Signal problem.
    Can you write the signal part in form of?

    if timelow<timehigh
    if tickprice>low+(high-low)*(1-level) openbuy and closesell
    if tickprice<low+(high-low)*(1-level) opensell and closebuy
    if timelow>timehigh
    if tickprice>low+(high-low)*level openbuy and closesell
    if tickprice<low+(high-low)*level opensell and closebuy

    I hope that this will resolve the No Signal problem.

    Thank you for your help.

  10. #10

    Default

    bump :d
    if you have some time Funyoo, it will be great

Similar Threads

  1. FiboBars EA
    By funyoo in forum Expert advisors backtesting
    Replies: 28
    Last Post: 07-28-2010, 18:06

Tags for this Thread

closing, color, funyoo, high, indicator, low, signal, signals, stop, thank you, time, trailing

Posting Permissions

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