Nanningbob 10.2 auto-trading EA

Share your 10.x automated traders here.
Locked
astral77
Trader
Posts: 171
Joined: Tue Nov 15, 2011 9:26 pm
Location: London

Re: 10.2; the auto-trading EA is born.

Post by astral77 »

garyfritz wrote:...Thanks for the clarification, Astral!
My pleasure. The beauty of it is that you do not even need to use a magic number. You can just choose the setting "manage all trades". The only problem I have had with it is that when choosing hide tp / sl and using jumping or trailing stops it closes the trades. Mind you I think the problem may be with me choosing conflicting settings!!! Well it is Saturday night and time to hit the single malt again.
Enjoy your weekend.
Kind regards
phil_trade

Re: 10.2; the auto-trading EA is born.

Post by phil_trade »

SteveHopwood wrote:
phil_trade wrote:So there is a pingpong with AdjustStopLoss() which remove SL to the line value :geek:
Yes, I know. Couldn't solve it for me, could you? You clearly understand coding to a level far beyond me. Once upon a time this blasted routine worked, then I accepted a change which broke it and it has remained broken ever since whatever I have tried to do. Never again, ever, will I fix something that aint broke, however much I respect the individual who offers the 'enhancement'.

I am very close to removing the bloody routine altogether and telling people to use mptm. It is what mptm is intended for, after all.

We are talking serious frustration and irritation here.

:D
Hi Steve

I think you can yell 'Yeppeee" as NB 10.2 V1u is working well for me with stealth.
I set Hidden pips to 40
I try on EURUSD D1/H4 Trend Trade 2011.01.24 8:00 buy 1.36050 SL 1.31327
I manually move the SL line to 1.35194 and when Bid cross 1.35194 the trade was closed by LookForTradeClosure() module !

So "Yeeeepppeeeee" :lol:

Philippe
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: 10.2; the auto-trading EA is born.

Post by SteveHopwood »

phil_trade wrote:
SteveHopwood wrote:
phil_trade wrote:So there is a pingpong with AdjustStopLoss() which remove SL to the line value :geek:
Yes, I know. Couldn't solve it for me, could you? You clearly understand coding to a level far beyond me. Once upon a time this blasted routine worked, then I accepted a change which broke it and it has remained broken ever since whatever I have tried to do. Never again, ever, will I fix something that aint broke, however much I respect the individual who offers the 'enhancement'.

I am very close to removing the bloody routine altogether and telling people to use mptm. It is what mptm is intended for, after all.

We are talking serious frustration and irritation here.

:D
Hi Steve

I think you can yell 'Yeppeee" as NB 10.2 V1u is working well for me with stealth.
I set Hidden pips to 40
I try on EURUSD D1/H4 Trend Trade 2011.01.24 8:00 buy 1.36050 SL 1.31327
I manually move the SL line to 1.35194 and when Bid cross 1.35194 the trade was closed by LookForTradeClosure() module !

So "Yeeeepppeeeee" :lol:

Philippe
It is the jumping stop with Stealth that causes the problem, with the error 1 messages it generates. It is trying to modify the stoploss with a value that is already the stoploss, and I cannot work out why.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
phil_trade

Re: 10.2; the auto-trading EA is born.

Post by phil_trade »

Hi Steve

I think you can yell 'Yeppeee" as NB 10.2 V1u is working well for me with stealth.
I set Hidden pips to 40
I try on EURUSD D1/H4 Trend Trade 2011.01.24 8:00 buy 1.36050 SL 1.31327
I manually move the SL line to 1.35194 and when Bid cross 1.35194 the trade was closed by LookForTradeClosure() module !

So "Yeeeepppeeeee" :lol:

Philippe[/quote]
It is the jumping stop with Stealth that causes the problem, with the error 1 messages it generates. It is trying to modify the stoploss with a value that is already the stoploss, and I cannot work out why.

:D[/quote]

Ok. Could you tell me an example : Pairs and date that I can reproduce the bug please
phil_trade

Re: 10.2; the auto-trading EA is born.

Post by phil_trade »

Philippe[/quote]
It is the jumping stop with Stealth that causes the problem, with the error 1 messages it generates. It is trying to modify the stoploss with a value that is already the stoploss, and I cannot work out why.

:D[/quote]

Steve, I hope this version is OK. I have seen a jumping SL OK with HiddenPip = 50

Code: Select all

//Philippe's code version II for Stealth .
void JumpingStopLoss() 
{
   // Jump sl by pips and at intervals chosen by user .
   //if (OrderProfit() < 0) return;//Nothing to do.
   
   //Use the sl line if this is drawn on the chart.
   string LineName = SlPrefix + DoubleToStr(OrderTicket(), 0);
   double sl = OrderStopLoss();
   double real_sl = 0;
   
   if (ObjectFind(LineName) > -1 || HiddenPips > 0)
   {
      sl = ObjectGet(LineName, OBJPROP_PRICE1);
            
   }//if (ObjectFind(LineName) > -1)
   
   //if (sl == 0) return;//No line, so nothing to do
   double NewStop;
   bool modify=false;
   bool result;
   
   
    if (OrderType()==OP_BUY)
    {

       if (sl == 0) real_sl = OrderStopLoss();
       else real_sl = NormalizeDouble(sl - (HiddenPips*Point),Digits);  

       if (real_sl < OrderOpenPrice() ) return;//Not at breakeven yet

       if (real_sl == 0) real_sl = OrderOpenPrice();                          //No hidden stop loss line
       if (Bid >=  real_sl + ((JumpingStopPips * 2) * Point) )
       {
          NewStop = NormalizeDouble(real_sl + (JumpingStopPips * Point), Digits);
          
          if (AddBEP) NewStop = NormalizeDouble(NewStop + (BreakEvenProfit*Point), Digits);
          
                    
          if (NewStop - real_sl > Point) modify = true;//George again. What a guy
       }// if (Bid>= sl + (JumpingStopPips*Point) && sl>= OrderOpenPrice())     
    }//if (OrderType()==OP_BUY)
       
       if (OrderType()==OP_SELL)
       {

       if (sl == 0) real_sl = OrderStopLoss();
       else real_sl = NormalizeDouble(sl + (HiddenPips*Point),Digits);  
              
          if (real_sl > OrderOpenPrice() ) return;//Not at breakeven yet

          if (real_sl== 0) real_sl = OrderOpenPrice();                           //No hidden stop loss line
          if (Bid <= real_sl - ((JumpingStopPips * 2) * Point) )
          {
             NewStop = NormalizeDouble(real_sl - (JumpingStopPips * Point), Digits);
             
             if (AddBEP) NewStop = NormalizeDouble(NewStop - (BreakEvenProfit*Point), Digits);
             
                          
             if (real_sl - NewStop > Point) modify = true;//George again. What a guy   
          }// close if (Bid>= sl + (JumpingStopPips*Point) && sl>= OrderOpenPrice())         
       }//if (OrderType()==OP_SELL)


             
   //Move 'hard' stop loss whether hidden or not. Don't want to risk losing a breakeven through disconnect.
   if (modify)
   {
      while (IsTradeContextBusy() ) Sleep(100);
      result = OrderModify(OrderTicket(), OrderOpenPrice(), NewStop, OrderTakeProfit(), OrderExpiration(), CLR_NONE);      
      if (!result) ReportError();
      else
      {      
      Print(Symbol()+" Jumping SL");
      
      if (OrderType()==OP_BUY)  ObjectMove(LineName, 0, Time[0], NormalizeDouble(NewStop + (HiddenPips*Point),Digits));
      if (OrderType()==OP_SELL) ObjectMove(LineName, 0, Time[0], NormalizeDouble(NewStop - (HiddenPips*Point),Digits));
      }
      if (PartCloseEnabled && OrderLots() > Preserve_Lots)// Only try to do this if the jump stop worked
      {
         bool PartCloseSuccess = PartCloseTradeFunction();
         //if (!PartCloseSuccess) SetAGlobalTicketVariable();
      }//if (PartCloseEnabled && OrderLots() > Preserve_Lots)
   }//if (modify)

} //End of JumpingStopLoss sub
I attach an modify EA so you can test it

cheers

Philippe
You do not have the required permissions to view the files attached to this post.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: 10.2; the auto-trading EA is born.

Post by SteveHopwood »

It is the jumping stop with Stealth that causes the problem, with the error 1 messages it generates. It is trying to modify the stoploss with a value that is already the stoploss, and I cannot work out why.

:D
Steve, I hope this version is OK. I have seen a jumping SL OK with HiddenPip = 50

I attach an modify EA so you can test it

cheers

Philippe
Hehe. You are so modest. As though anything you code might actually be wrong. :lol:

Version 1v is in post 1; it is the previous version plus Philippe's fix, so if you downloaded his then you do not need the update.

Coders, sometime this week, I shall replace the code in the shell functions with Philippe's code.

Thanks Philippe.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
phil_trade

Re: 10.2; the auto-trading EA is born.

Post by phil_trade »

:evil:
SteveHopwood wrote:
It is the jumping stop with Stealth that causes the problem, with the error 1 messages it generates. It is trying to modify the stoploss with a value that is already the stoploss, and I cannot work out why.

:D
Steve, I hope this version is OK. I have seen a jumping SL OK with HiddenPip = 50

I attach an modify EA so you can test it

cheers

Philippe
Hehe. You are so modest. As though anything you code might actually be wrong. :lol:

Version 1v is in post 1; it is the previous version plus Philippe's fix, so if you downloaded his then you do not need the update.

Coders, sometime this week, I shall replace the code in the shell functions with Philippe's code.

Thanks Philippe.

:D
you're welcome :shock:

Don't you forget to put extern HiddenPip parameter ? :evil:
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: 10.2; the auto-trading EA is born.

Post by SteveHopwood »

phil_trade wrote:you're welcome :shock:

Don't you forget to put extern HiddenPip parameter ? :evil:
Oops. Can't remember everything, as I am constantly reminding piano pupils when the forget the latest rock-bottom basic. :lol:

The three of you who downloaded the previous V1v need to re-download if you want to use Stealth.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
garyfritz

Re: 10.2; the auto-trading EA is born.

Post by garyfritz »

I'm still learning the system. I'm finding Verb's codex to be very useful -- now I'm just trying to find where Verb found those things in NB's booklets. :D

I wanted a bit more visual representation of the info in Verb's codex, so I condensed all the entry conditions into a table. This way you can easily see how the various entry types differ, or scan down the columns to see "OK if the H4 TMA is this and the H1 TMA is that, what should I be doing?"

Not sure if this will actually be helpful, but I offer it here in case it helps somebody understand this stuff. Please let me know if you find any errors.

Here it is in the order Verb listed them in his codex:
InOrder.gif
Here it is sorted with long entries first, short entries second:
LSorder.gif
You do not have the required permissions to view the files attached to this post.
User avatar
mobthehop
Trader
Posts: 362
Joined: Wed Nov 16, 2011 12:16 am

Re: 10.2; the auto-trading EA is born.

Post by mobthehop »

Gary, this is helpful but I would not necessarily distinguish the different trade tfs as the methodology / trade conditions are same on H1/H4 / D1....

Over at FF, Binyamin just posted the following flow chart, which, I believe, is quite similar to your table - see attached. I think the referenced "blue line" is the MA 5 shift 1 of NB10.2 templates

As such, the decision process to go long or short is detailed, but from what I recall, NB only enters either on break of or bounce at daily / weekly pivot lines combined with MA cross confirmation (there are different MA 5 shifts associated with his currency groups 1 - 5). I will however re-read the manual for the fifth time and the last 100 or so posts of NB.....

As we are talking about 24 different currencies and I am quite partial to the "ducks in the row concept", I would be very interested to develop a traffic light system of 4-5 conditions that need to be met, then place pending buy x pips over next S/R line for break condition AND a pending sell y pips below next S/R line (for bounce at S/R)

Does that make sense?

BTW, as one of the sharpest minds here, would you be able to help me understand pivots (as calculated in NB 10.2) vs Fibonacci based pivots based weekly open time (eg London open vs NY Open vs broker open) etc - I simply don't get it

Cheers

Mop
You do not have the required permissions to view the files attached to this post.
Locked

Return to “10.x EA forum”