Know more about other "Trading Strategies" - page 4

 
doshur: averaging in is always ok, when you have huge lot size and wants to exit, there might be no volume for you to exit at the price u want.

when news release, i wonder if this system can survive like aud these days 

Imo, anything can survive if the lot_size is small enough. If it'll be worth it for you is another question altogether. Can you submit a system which can do better on Aud these days? Just as a reminder, this is not a thread about other peoples profitable systems. This is a thread where my intend is that people submit different experts and review the good and bad about the strategy. Profitable or Not does not matter.
 

I found a bug within the YesLstTrdWin() function.

bool YesLstTrdWin(){
    if(!PositionSelect(CurSetSymbol)){return(false);}
    ulong   PosType=PositionGetInteger(POSITION_TYPE);
    ulong   PosOpTime=PositionGetInteger(POSITION_TIME);
    double  PosPrice=PositionGetDouble(POSITION_PRICE_CURRENT);
    HistorySelect(PosOpTime,TimeCurrent());
    int DealsTotal=HistoryDealsTotal();
    for(int i=DealsTotal-1; i>=0; i--){
        ulong DealTicket=HistoryDealGetTicket(i);
        ulong DealEntry=HistoryDealGetInteger(DealTicket,DEAL_ENTRY);
        if(DealEntry!=DEAL_ENTRY_IN){continue;}
        ulong DealMagic=HistoryDealGetInteger(DealTicket,DEAL_MAGIC);
        if(DealMagic!=SystemMagic1){continue;}
        string DealSymb=HistoryDealGetString(DealTicket,DEAL_SYMBOL);
        if(DealSymb!=CurSetSymbol){continue;}
        ulong  DealType=HistoryDealGetInteger(DealTicket,DEAL_TYPE);
        double DealPrice=HistoryDealGetDouble(DealTicket,DEAL_PRICE);
        if(DealType==DEAL_TYPE_BUY  && PosPrice>DealPrice){return(true);}
        if(DealType==DEAL_TYPE_SELL && PosPrice<DealPrice){return(true);} //This Line Was Left Out.
        return(false);
    }   return(false);
}

I forgot the last sell deal checker which cased it to average in-side the position range.

*On another note: averaging inside and/or anti-grids can be an effective strategy for trending systems. 

 
Ubzen:

I found a bug within the YesLstTrdWin() function.

I forgot the last sell deal checker which cased it to average in-side the position range.

*On another note: averaging inside and/or anti-grids can be an effective strategy for trending systems. 

Hi Ubzen,

I saw this thread a while back and I had been intending to contribute, sorry I delayed I hope this becomes one of those mini forums threads within mql5. The fact you're using a non optimized random signal for steady profits is certainly promising. I am yet to actually study the signal in fact I just saw the code today and I zoomed straight to your MaxDDCurrency()  function. It has a line I think could be a bug...

Should this

if(TempDD>MaxDDCurency){return;}

 

 be this?

 

if(TempDD<=MaxDDCurency){return;}

 

 On another general note. How dependable do you think is the price data in strategy tester especially as far as the spread is concerned?

 PS: Will post one of mine as well soon. 

 

You also seem to be calling

BrkEveEquity();

 

 On tick. Shouldn't you be calling this from within the HighestEquity() function i.e. when a new equity high is set. Sorry if my comments seem off  Am yet to  actually test the EA myself in strategy tester but I thought I would get a feel for what you were thinking when you wrote this.

 
ssn: Hi Ubzen, I saw this thread a while back and I had been intending to contribute, sorry I delayed I hope this becomes one of those mini forums threads within mql5. The fact you're using a non optimized random signal for steady profits is certainly promising. I am yet to actually study the signal in fact I just saw the code today and I zoomed straight to your MaxDDCurrency()  function. It has a line I think could be a bug...

Should this be this? On another general note. How dependable do you think is the price data in strategy tester especially as far as the spread is concerned? PS: Will post one of mine as well soon. 

Entire function:

void MaxDDCurency(){
    int TempDD=AcountEquity-HighesEquity;
    if(TempDD>MaxDDCurency){return;}
    MaxDDCurency=TempDD;
}

1) Sets Maximum DrawDown in Currency. This function sets the global variable with the same name to -Negative lowest drawdown in account currency. Because it's value is negative, you'll want to think in reverse. Example Highest_Equity=10,000. Account_Equity=9,500. I want the maximum drawdown in $ of -500. Works out as [9,500 - 10,000]. Then if Temporary Draw Down is less than -500, I want that to register as the new MaxDD.

2) The spreads are much higher in the strategy tester than most people would pay today. Its my opinion because allot of brokers are offering sub-pips. The price data doesn't matter that much. The EA does-not process within one-minute bars, it only processes at the opening of the m1 bar of the chart its attached to. Unless your data is missing allot of m1 bars, this method should be reliable enough.

3) The result I received was the first result I got after putting it together. After that I ran other tests which were not-so-promising. But even with the 3 other tests I ran, the system ended slightly profitable or slightly un- profitable. But yea, the fact still stands that a random, un-optimized system still survived through 2008 crisis all the way through 2012. Maybe optimizing such a system could be a subject of further study. Example: your personal direction, **cant do worse than random right ;)

4) Sure, post a system you always taught was interesting and anything which bothers you about that system. I'll try to suggest ideas which could counter those problems.

 
ssn: You also seem to be calling On tick. Shouldn't you be calling this from within the HighestEquity() function i.e. when a new equity high is set. Sorry if my comments seem off  Am yet to  actually test the EA myself in strategy tester but I thought I would get a feel for what you were thinking when you wrote this.

Entire Function:

void BrkEveEquity(){
    if(SysMagTotCnt()!=0){return;}
    BrkEveEquity=HighesEquity;
    BrkEveEquTme=(int)TimeCurrent();
    SysCloseMode=false;
}
The Break-Even Equity I've used for quite some time now. Sometime this function is within the Equity_High function but I believe I removed from that location a long time ago for the following reasons. 1) If Break-Even Equity is within Equity_High then I don't need the BE as I could just use Equity_High instead. 2) I want to set the Equity_High when a new Account_Equity High is reached and not when System_Magic_Total_Count==0.  3) I want to set Break_Even when All_Symbols are closed. This offers the following advantages when trading in Live. When you close all_positions, you might suffer from some negative slippage.  Your new target becomes Equity_High + Target$$$ instead of Account_Balance + Target$$ for example.
 

 - Yes the DD is negative, I had not seen that. Thx

 - I think even m1 open prices have a bid and ask. If your entry is on bid you will have to exit on ask (e.g. if you shorted). I have done tests with mt5 data and with a custom fixed spread, and the results are glaringly different.

-  I think your approach with the random signal is the way to go if your entry is technicals based. If you can keep out any optimization that should be better... I think. ;)...

- The system I will post uses SOM... actually it will be a reusable class. Need to do some final tweaks...

- Okay thats clear on BE. Now the MinPerMinLot is a fixed variable that you use to set your volume in proportion to the time since all positions were closed? 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants - Documentation on MQL5
 
ssn:

 - Yes the DD is negative, I had not seen that. Thx

 - I think even m1 open prices have a bid and ask. If your entry is on bid you will have to exit on ask (e.g. if you shorted). I have done tests with mt5 data and with a custom fixed spread, and the results are glaringly different.

-  I think your approach with the random signal is the way to go if your entry is technicals based. If you can keep out any optimization that should be better... I think. ;)...

- The system I will post uses SOM... actually it will be a reusable class. Need to do some final tweaks...

- Okay thats clear on BE. Now the MinPerMinLot is a fixed variable that you use to set your volume in proportion to the time since all positions were closed? 

1) You're welcome.

2) Agreed. Wish we could fix the spreads in mt5. But it's also important to test with realistic spreads and not fool oneself.

3) My experience, with optimized systems, the one-month live test usually look totally different from results expected. This manner of testing usually produce expected stats during my live tests.... but also usually dies the same manner it dies within the strategy tester.

4) k

5) Yes. Pretty much, but much better to view it as "since account_equity was >= break-even equity". I've taken the Set_Break_Even_Time out of the Break_Even_Equity function. I'm realizing that setting individual variables with their own set_function works much more re-usable then bundling into another set_function.

I'm thinking about doing a trend following system next with adding lots as trend progresses.

 
Ubzen:

1) You're welcome.

2) Agreed. Wish we could fix the spreads in mt5. But it's also important to test with realistic spreads and not fool oneself.

3) My experience, with optimized systems, the one-month live test usually look totally different from results expected. This manner of testing usually produce expected stats during my live tests.... but also usually dies the same manner it dies within the strategy tester.

4) k

5) Yes. Pretty much, but much better to view it as "since account_equity was >= break-even equity". I've taken the Set_Break_Even_Time out of the Break_Even_Equity function. I'm realizing that setting individual variables with their own set_function works much more re-usable then bundling into another set_function.

I'm thinking about doing a trend following system next with adding lots as trend progresses.

4)...
Files:
SignalSOM.mqh  24 kb
 
ssn: 4)...
??? Do you have the additional stuff according to the rules. #1, #3 and #4 appears to be missing.
Reason: