stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Bob and Shelley Again
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=2759
Page 52 of 120
Author:  SteveHopwood [ Wed Oct 23, 2013 8:07 pm ]
Post subject:  Re: Bob and Shelley Again

fchaman wrote:This long eurcad 4hr has been executed very well since Oct. 21, and it is only 70 pips shy of TP 300pips...amazing EA!
It is indeed wonderful to experience. I think a lot of us are awakening to new possibilities.

Now, imagine you had stack trading enabled and where you would be right now.

Whether you enable stacking or not, enjoy the ride; the rest of us are. We do endure losers, but not often.

:D
Author:  fchaman [ Wed Oct 23, 2013 8:18 pm ]
Post subject:  Re: Bob and Shelley Again

Yes indeed Steve...after I doubled my initial balance, will activate stacking!
Author:  fchaman [ Wed Oct 23, 2013 9:34 pm ]
Post subject:  Re: Bob and Shelley Again

Well, tried to activate stacking only on one pair USDCHF, and keep getting this error:

Bob and Shelley Again_v2h 19479261 CountOpenTrades take profit modification failed with error 130: invalid stops
Author:  SteveHopwood [ Wed Oct 23, 2013 10:07 pm ]
Post subject:  Re: Bob and Shelley Again

fchaman wrote:Well, tried to activate stacking only on one pair USDCHF, and keep getting this error:

Bob and Shelley Again_v2h 19479261 CountOpenTrades take profit modification failed with error 130: invalid stops
Will look into this tomorrow.

:D
Author:  SteveHopwood [ Wed Oct 23, 2013 10:27 pm ]
Post subject:  Re: Bob and Shelley Again

fchaman wrote:Well, tried to activate stacking only on one pair USDCHF, and keep getting this error:

Bob and Shelley Again_v2h 19479261 CountOpenTrades take profit modification failed with error 130: invalid stops
Just a quickie to let you guys know that Tommaso and I have narrowed the problem down to this snippet of code within void CountOpenTrades):

Code: Select all

      //TP line for stack trades
      if (MaxTradesAllowed > 1)
      {
         if (ObjectFind(tpline) == -1)
         {
            DrawHorizontalLine(tpline, OrderTakeProfit(), StackTpLineColour, STYLE_DASH, 0);
         }//if (ObjectFind(tpline) == -1)
         //Has the user moved the line to adjust the tp?
         double lp = ObjectGet(tpline, OBJPROP_PRICE1);
         if (!CloseEnough(OrderTakeProfit(), lp) && !(CloseEnough(lp, 0)))
         {
            result = (OrderTicket(), OrderOpenPrice(), OrderStopLoss(), NormalizeDouble(lp, Digits), OrderExpiration(), CLR_NONE);
            if (!result) ReportError(" CountOpenTrades ", tpm);
            ObjectSet(tpline, OBJPROP_PRICE1, NormalizeDouble(lp, Digits) );
         }//if (!CloseEnough(OrderTakeProfit(), lp) )         
      }//if (MaxTradesAllowed > 1)      
No idea what is wrong, mind. Any ideas, guys?

More tomorrow. Off to bed now. If one of you geniuses can solve this, I shall be forever in your debt.

:D
Author:  garyfritz [ Wed Oct 23, 2013 10:48 pm ]
Post subject:  Re: Bob and Shelley Again

I assume you actually do still have the OrderModify in the result = ... line ?

Have you tried checking the value of lp ? Or OrderStopLoss(), though that seems unlikely...
Author:  milanese [ Wed Oct 23, 2013 10:54 pm ]
Post subject:  Re: Bob and Shelley Again

garyfritz wrote:I assume you actually do still have the OrderModify in the result = ... line ?

Have you tried checking the value of lp ? Or OrderStopLoss(), though that seems unlikely...
it seems like the EA wants to change the tp in all open pair , too in other pairs like in this post http://www.stevehopwoodforex.com/phpBB3 ... 4&start=87 as you see NJ and EU have the same TP...
what is really strange..

Cheers :)
Tommaso
Author:  gaheitman [ Thu Oct 24, 2013 1:58 am ]
Post subject:  Re: Bob and Shelley Again

SteveHopwood wrote:
fchaman wrote:Well, tried to activate stacking only on one pair USDCHF, and keep getting this error:

Bob and Shelley Again_v2h 19479261 CountOpenTrades take profit modification failed with error 130: invalid stops
Just a quickie to let you guys know that Tommaso and I have narrowed the problem down to this snippet of code within void CountOpenTrades):

Code: Select all

      //TP line for stack trades
      if (MaxTradesAllowed > 1)
      {
         if (ObjectFind(tpline) == -1)
         {
            DrawHorizontalLine(tpline, OrderTakeProfit(), StackTpLineColour, STYLE_DASH, 0);
         }//if (ObjectFind(tpline) == -1)
         //Has the user moved the line to adjust the tp?
         double lp = ObjectGet(tpline, OBJPROP_PRICE1);
         if (!CloseEnough(OrderTakeProfit(), lp) && !(CloseEnough(lp, 0)))
         {
            result = (OrderTicket(), OrderOpenPrice(), OrderStopLoss(), NormalizeDouble(lp, Digits), OrderExpiration(), CLR_NONE);
            if (!result) ReportError(" CountOpenTrades ", tpm);
            ObjectSet(tpline, OBJPROP_PRICE1, NormalizeDouble(lp, Digits) );
         }//if (!CloseEnough(OrderTakeProfit(), lp) )         
      }//if (MaxTradesAllowed > 1)      
No idea what is wrong, mind. Any ideas, guys?

More tomorrow. Off to bed now. If one of you geniuses can solve this, I shall be forever in your debt.

:D
Is it possible that the code a few lines above the snippet you show that is changing the SL to 0 is the issue? I remember in older versions the OrderStopLoss() function wouldn't update after an OrderModify() unless you re-selected the order.

(just my tarnished two cents -- mostly to show I still have Internet access :>)

George
Author:  Mescalitofx [ Thu Oct 24, 2013 2:01 am ]
Post subject:  Re: Bob and Shelley Again

Dont know if it can help. when opening and modifying orders.


First, you might want to know what’s the minimum stoplevel is set in your broker’s Empty4 server. Adding this line of code will output the current minimum stoplevel for the currency pair of the chart, where you run the EA:

Code: Select all

Print(MarketInfo(Symbol(), MODE_STOPLEVEL));
You shouldn’t be using stop-loss or take-profit level, which are closer than MarketInfo(Symbol(), MODE_STOPLEVEL) to the current market price. If your EA calculates stops and take-profits dynamically, this is what I suggest you to do:

1. Declare a global variable for the minimum StopLevel; e.g.:

Code: Select all

int StopLevel;
2. In the init() function of your expert advisor define the minimum StopLevel:

Code: Select all

StopLevel = MarketInfo(Symbol(), MODE_STOPLEVEL) + MarketInfo(Symbol(), MODE_SPREAD);
Note, that adding a spread difference is also required.

3.The next time your stop-loss or take-profit is calculated, just check them to be not less than StopLevel:

Code: Select all

if (StopLoss < StopLevel) StopLoss = StopLevel;
if (TakeProfit < StopLevel) TakeProfit = StopLevel;
4.Don’t forget to refresh the current market rates with

Code: Select all

RefreshRates()
before adding the stop-loss/take-profits levels to the actual market rates.

That should help in the majority of the cases.

//(snippit from http://www.earnforex.com/blog/ordersend ... hat-to-do/ )
Author:  stevelacoste [ Thu Oct 24, 2013 7:22 am ]
Post subject:  Re: Bob and Shelley Again

Hi Guys

After installing the latest BASA yesterday is it normal for it to only take one trade although I have eight currency pairs

Thanks Steve
All times are UTC Page 52 of 120