Opinion - very successfull EA - $3000 account to $6300 in two weeks (could have been $9000) - page 6

 
so you do the actual check in the MoveTrailingStop() function?
 
zzuegg:
so you do the actual check in the MoveTrailingStop() function?

I did that check, yes, you gave me the idea, I was struggling to work out the logic. but I hacked the function itself from another EA on the web, but I do understand what it is doing now. I do work hard at this and I am getting better.

most of what I am doing is copying and watching to see how they work. Im just learning how functions work by examples, as you will see from above. This topic could really use a good book.

 
MickGlancy:

ive collected lots of examples of trailing stops, but I need one which starts to trail immediately through the -ve values to 0, and then stop like a break even.

so if the market entry price is taken and the stop loss is 100, id the price moves to +25, the trailing stop moves to -75, and then once the price reaches 100, the trailing stop stops at 0 and doesnt move any further.

could anyone help me with this ? I have spent all day trying to get it to work and I just cant.

I thought I had done it but I haven't, my trailing stop follows through 0.

extern double Dist = 25;      //--- the distance you'd like your stops to trail.. in your case 25 pips
extern int EA_Majik = 12345;  //--- EA's magic number

start()
{
   //.......
   double min=NormalizeDouble(MarketInfo(Symbol(),MODE_STOPLEVEL)*Point,Digits);   
   for(i=OrdersTotal()-1;i>=0;i--)
   {
      OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      if(OrderMagicNumber()==EA_Majik && OrderSymbol()==Symbol())
      {
         if(OrderStopLoss() > 0)   //--- Must have an existing stoploss to trail
         {
            if(OrderType()==OP_BUY)
            {
               if(Bid-OrderOpenPrice() < 100)                                                           //--- only trail if price moves within 100 pips
               {
                  double LastSL.Lng = OrderStopLoss();                                                  //--- get the current SL level
                  double SL.Lng = NormalizeDouble(Bid-Dist*Point,Digits);                               //--- get the new SL level
                  if(SL.Lng < LastSL.Lng)    SL.Lng = LastSL.Lng;                                       //--- never move SL away from price.. if this is the case, keep it the same
                  if(SL.Lng > Bid-min)       {Print("STOPLOSS too close to market: ",SL.Lng,", Adjusted to min: ",(Bid-min)); SL.Lng=Bid-min;}      
                  if(SL.Lng != LastSL.Lng)   OrderModify(OrderTicket(),OrderOpenPrice(),SL.Lng,OrderTakeProfit(),0,Lime);
               } 
            }
            if(OrderType()==OP_SELL)
            {
               if(OrderOpenPrice()-Ask < 100)
               {
                  double LastSL.Shrt = OrderStopLoss();
                  double SL.Shrt = NormalizeDouble(Ask+Dist*Point,Digits); 
                  if(SL.Shrt > LastSL.Shrt)   SL.Shrt = LastSL.Shrt; 
                  if(SL.Shrt < Ask+min)       {Print("STOPLOSS too close to market: ",SL.Shrt,", Adjusted to min: ",(Ask+min)); SL.Shrt=Ask+min;}         
                  if(SL.Shrt != LastSL.Shrt)  OrderModify(OrderTicket(),OrderOpenPrice(),SL.Shrt,OrderTakeProfit(),0,Red);
               }
            }
         }
      }
      else Print("STOPLOSS does not exist.");
   }
   // .........
   return(0);
}

The code above should do what you described.. I just put it together in the post box and didn't test it so if there are issues let me know..

Now let me ask you this, in the code you posted earlier, you had this for your entry signals:

      double MA1=iMA(NULL,0,100,0,1,0,0);
      double MA2=iMA(NULL,0,100,0,1,0,1);
      double MA3=iMA(NULL,0,40,0,1,0,0);
      double MA4=iMA(NULL,0,40,0,1,0,1);

      if(MA1 < MA3 && MA2 > MA4) // Go Long  
      if(MA1 > MA3 && MA2 < MA4) // Go Short 

Are these your only entry signals for your strategy?

 
supertrade:

The code above should do what you described.. I just put it together in the post box and didn't test it so if there are issues let me know..

Now let me ask you this, in the code you posted earlier, you had this for your entry signals:

Are these your only entry signals for your strategy?

no they aren't. Someone on here advised me to change the entry signals for the time being until a time came when I was happy to reveal what I am doing. I picked them out of a basic EA just to fill the space.

thankyou very much for that.

 
no problem.. FYI, I updated the code I posted above... noticed some errors
 

nevermind

 

Summary:
Deposit/Withdrawal: 5 000.00 Credit Facility: 0.00
Closed Trade P/L: 6 848.30 Floating P/L: 0.00 Margin: 0.00
Balance: 11 848.30 Equity: 11 848.30 Free Margin: 11 848.30
Details:
Gross Profit: 6 848.30 Gross Loss: 0.00 Total Net Profit: 6 848.30
Profit Factor: Expected Payoff: 14.39
Absolute Drawdown: 0.00 Maximal Drawdown: 0.00 (0.00%) Relative Drawdown: 0.00% (0.00)
Total Trades: 476 Short Positions (won %): 1 (100.00%) Long Positions (won %): 475 (100.00%)
Profit Trades (% of total): 476 (100.00%) Loss trades (% of total): 0 (0.00%)
Largest profit trade: 15.20 loss trade: 0.00
Average profit trade: 14.39 loss trade: 0.00
Maximum consecutive wins ($): 476 (6 848.30) consecutive losses ($): 0 (0.00)
Maximal consecutive profit (count): 6 848.30 (476) consecutive loss (count): 0.00 (0)
Average consecutive wins: 476 consecutive losses: 0

Hi every one...

I am posting this purely for comparison purposes.

You will see in this post, the number of trades is shown, where Mick's posting has it removed. Why?

The second reason for this post is to show that that amazing results are possible in short periods - this is a series of trades taken in a demo account in a two hour period.

I'd post the code but it is really not my best work! In fact, this happened because of an absurdly silly programming oversight.

sn

 

why dont you just ask me in a pm or do you want to have a go at me now publicly ? ? ? ? ?

You achieved that much profit in a couple of hours with NO loss trades ? I doubt it very much, if you were trading that well, you would not be wasting your time on internet forums, with 24 posts to your account and asking questions about someone elses business. you would not care. Those results are either off a back tester or you have made them up my friend.

Like I said before, if you can not post something constructive on this thread, please do not post at all. Go away back to wherever you came from.

Actually, Ive made a mistake in my approach to this forum, I will end my activity on this thread here, and not return to it. Instead I will start studying other posts in the forum as take it from there. Thankyou for your positive input in this thread.

 
there's no need to be so touchy, people will always have doubts...if you say you going to do something I think you owe it to urslef to pull through with it, regardless it's your work so you can do as u please, I enjoyed it while it lasted though...and learnt a few things too
 

I am looking for the opinion of some of the experienced people on here. I have programmed a simple EA, and it seems to work fantastic on a demo account.

==>> I also programmed a simple EA and got fantastic results and posted here just like you to answer your question about the possibility of you over-looking something just like I did in mine. My trading strategy was out of control and just hit the market at the right time - it could wrongly be considered successful.

The reason I am asking is that it seems too good to be true and I am worried I have missed something.

==>> it is possible based on my experience above.

I guess this was the post I should have made - sorry Mick.

Reason: