Results 1 to 7 of 7
 5 Attachment(s)    

Thread: Simple Parabolic SAR EA

  1. #1

    Default Simple Parabolic SAR EA

    I have been following this ea for a while now.

    Its freely available from Pip Cop - Forex Robot Reviews. Very nice site that forward tests ea on live and demo.

    This ea works on eurusd 30 min. It places short (sell) trades only. It appears that longs (buy) do not work well.

    I tried it with my FXDD broker but the results were poor. Maybe this ea is broker specific or time specific.

    I decided to try it on eurjpy and I had better results.

    I tried to filter out the bad trades by only taking sell candles and I tried to stop reverses by closing trades that closed with a buy candle above an EMA 3 on the 15 chart.

    I'm not much of a coder. I don't think the EMA3 is in the correct part of code to stop bad trade.

    I think I am on the right track with this ea. If the trade is going to go in our favor it seems to happen very quickly. By the same token if it goes against us it also happens quickly.

    I messed around with the trailing stop amount, I think that might have cut my profits.

    A better way might be to take stepped profit to lock in pips.
    Maybe up 15 pips lock 3, up 25 lock 10, up 30 lock 15, or something like that.

    I also noticed that ea makes multiple trades in the same candle. Might be better to take one or two profit from candle and wait for next trade setup.

    Please ignore the eurusd trades in statement. At first glance the statement may not look good, If we can find a way to cut losses quickly, you can see that you had more winners than loosers.

    I have included the original code, my modified code, and my current forward statement.

    I also added in a mixed statement that has several ea's in it when I was doing my initial tests. Just ignore everything and concentrate on the macd sample ones (thats actually the parabolic sar).
    Attached Images Attached Images Simple Parabolic SAR EA-sar2-ma-stop-eurjpy-m30-fxdd-gif 
    Attached Files Attached Files
    Last edited by EvertonHarding; 12-29-2008 at 06:05.

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

    Default

    Thanks for sharing these codes,

    What do you want to do exactly ?

  3. #3

    Default

    Quote Originally Posted by funyoo View Post
    Thanks for sharing these codes,

    What do you want to do exactly ?
    I think the following items would improve the profits and get you out of bad trades quicker.

    1. Filter bad trades by closing trade when a candle closes above a EMA 3 on the 15 chart. Can you check to see if I have done this correctly?

    2. Add a stepped profit to lock in pips.
    Trade up 15 pips move SL to in lock 3 pips, up 25 lock 10, up 30 lock 15, or something like that. User should be able to adjust values for best profit.

    3. Have setting to limit amount of trades it opens when conditions are met. I noticed it opens several trades during candle open, especially if trailing stop is a low value (around 9). It would hit TS and then open another trade because candle is still not formed and trade conditions are still met.

    4. Add a method to close trade after X number of candles. The idea on this is if trade is open it should go into profit fairly quickly (within 5 bars) on a lower time frame. If it does not then it usually reverses so we should close quickly.

    5. Be able to trade by tick mode or by closed candle mode.

    Thanks
    Last edited by EvertonHarding; 12-29-2008 at 18:21.

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

    Default

    Quote Originally Posted by EvertonHarding View Post
    1. Filter bad trades by closing trade when a candle closes above a EMA 3 on the 15 chart. Can you check to see if I have done this correctly?
    You have forgotten the parenthesis here :

    if( (SARCurrent<Bid && SARPrevious>Bid) ||(Close[1] > Filter))

    Note that it will generate some conflicts.

    Quote Originally Posted by EvertonHarding View Post
    2. Add a stepped profit to lock in pips.
    Trade up 15 pips move SL to in lock 3 pips, up 25 lock 10, up 30 lock 15, or something like that. User should be able to adjust values for best profit.
    I suggest you to create a function for this :

    Code:
    void ModSL(double ldSL){bool fm;fm=OrderModify(OrderTicket(),OrderOpenPrice(),ldSL,OrderTakeProfit(),0,CLR_NONE);}
    then to create the conditions, if ((Bid-OrderOpenPrice())>=X*Point)ModSL(Bid-(X-Y)*Point);

    Etc...

    Quote Originally Posted by EvertonHarding View Post
    3. Have setting to limit amount of trades it opens when conditions are met. I noticed it opens several trades during candle open, especially if trailing stop is a low value (around 9). It would hit TS and then open another trade because candle is still not formed and trade conditions are still met.
    See here to limit the number of trades : http://www.tradingsystemforex.com/mq...each-tick.html

    Quote Originally Posted by EvertonHarding View Post
    4. Add a method to close trade after X number of candles. The idea on this is if trade is open it should go into profit fairly quickly (within 5 bars) on a lower time frame. If it does not then it usually reverses so we should close quickly.
    You have to study the datetime, when an order is generated you set a value to a datetime parameter. For example.

    datetime dateorder;

    ...

    OrderSend(....);dateorder=CurTime();

    if((CurTime()-dateorder)>=X)OrderClose(..);

    Quote Originally Posted by EvertonHarding View Post
    5. Be able to trade by tick mode or by closed candle mode.

    See the trenchaser supernova code for that.

  5. #5

    Default

    Quote Originally Posted by funyoo View Post
    You have forgotten the parenthesis here :

    if( (SARCurrent<Bid && SARPrevious>Bid) ||(Close[1] > Filter))

    Note that it will generate some conflicts.



    I suggest you to create a function for this :

    Code:
    void ModSL(double ldSL){bool fm;fm=OrderModify(OrderTicket(),OrderOpenPrice(),ldSL,OrderTakeProfit(),0,CLR_NONE);}
    then to create the conditions, if ((Bid-OrderOpenPrice())>=X*Point)ModSL(Bid-(X-Y)*Point);

    Etc...



    See here to limit the number of trades : http://www.tradingsystemforex.com/mq...each-tick.html



    You have to study the datetime, when an order is generated you set a value to a datetime parameter. For example.

    datetime dateorder;

    ...

    OrderSend(....);dateorder=CurTime();

    if((CurTime()-dateorder)>=X)OrderClose(..);




    See the trenchaser supernova code for that.
    Wow! That's a lot of stuff. I can modify some code. What you just said is beyond me. Can you code what you just said, I think this would make profitable.

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

    Default

    I have not enough time to modify the code of everybody. I suggest you to do it yourself for your education, also as it is your own template.

  7. #7

    Default

    Quote Originally Posted by funyoo View Post
    I have not enough time to modify the code of everybody. I suggest you to do it yourself for your education, also as it is your own template.
    Thanks I will try.

Similar Threads

  1. Parabolic SAR EA
    By funyoo in forum Expert advisors backtesting
    Replies: 122
    Last Post: 03-19-2016, 17:25
  2. Parabolic SAR EA
    By mehoolsheth in forum Expert advisors backtesting
    Replies: 1
    Last Post: 03-18-2011, 14:16
  3. SAR Parabolic Indicator
    By tattoo-angel in forum Indicators
    Replies: 2
    Last Post: 03-07-2011, 10:53
  4. FT_Scalp Parabolic
    By funyoo in forum Expert advisors backtesting
    Replies: 209
    Last Post: 05-03-2010, 23:15

Tags for this Thread

broker, candle, candles, change, closing, color, demo, ea works, eurjpy, eurusd, forex, forex robot, live, low, macd, mql, parabolic sar, pips, profit, profitable, programming, robot, sample, simple, stop, study, time, trade setup, 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
  •