Bob and Shelley Again

Locked
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: Bob and Shelley Again

Post by SteveHopwood »

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
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.
fchaman
Trader
Posts: 119
Joined: Sat Nov 19, 2011 1:13 pm
Location: End of the world

Re: Bob and Shelley Again

Post by fchaman »

Yes indeed Steve...after I doubled my initial balance, will activate stacking!
fchaman
Trader
Posts: 119
Joined: Sat Nov 19, 2011 1:13 pm
Location: End of the world

Re: Bob and Shelley Again

Post by fchaman »

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
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: Bob and Shelley Again

Post by SteveHopwood »

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
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.
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: Bob and Shelley Again

Post by SteveHopwood »

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
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: Bob and Shelley Again

Post by garyfritz »

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...
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Re: Bob and Shelley Again

Post by milanese »

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
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: Bob and Shelley Again

Post by gaheitman »

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
Mescalitofx
Trader
Posts: 27
Joined: Thu Feb 21, 2013 6:55 pm

Re: Bob and Shelley Again

Post by Mescalitofx »

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/ )
...
stevelacoste
Trader
Posts: 22
Joined: Thu Nov 24, 2011 10:43 pm

Re: Bob and Shelley Again

Post by stevelacoste »

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
Locked

Return to “Automated trading systems”