HELP WITH ERROR 130 FOR PENDING ORDER SCRIPT

fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: HELP WITH ERROR 130 FOR PENDING ORDER SCRIPT

Post by fx800 »

fx8000 wrote:
fxdaytrader wrote:Yes, I overlooked that by copy&pasting ...

On the other hand - It seems that it does not matter (I think when OrderSymbol() ist empty, it will be set to NULL, that could be the reason because it is working as desired). Better change to Symbol(), thats correct ...

btw I uploaded the scripts again (with the mistake corrected) ...
Thanks.
The latest update doesn't work, the one with OrderSymbol works :P
User avatar
fxdaytrader
Trader
Posts: 190
Joined: Sun Jun 10, 2012 7:03 am
Location: Poon-Town (germany, se-asia, se-europe) ...

Re: HELP WITH ERROR 130 FOR PENDING ORDER SCRIPT

Post by fxdaytrader »

That is confusing me, :shock:

I did a "debug run" (just put on the begin of start() {):

Code: Select all

Alert("symbol: "+Symbol()+"|OrderSymbol: "+OrderSymbol()+"|null: "+NULL); return;
result:
Symbol() = DAX30
OrderSymbol() = (NOTHING)
NULL = 0

NULL seems to work also. Interesting to know.

Is this one "crapperquotes housemade problem"? I don't know. :mrgreen:
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: HELP WITH ERROR 130 FOR PENDING ORDER SCRIPT

Post by fx800 »

fxdaytrader wrote:That is confusing me, :shock:

I did a "debug run" (just put on the begin of start() {):

Code: Select all

Alert("symbol: "+Symbol()+"|OrderSymbol: "+OrderSymbol()+"|null: "+NULL); return;
result:
Symbol() = DAX30
OrderSymbol() = (NOTHING)
NULL = 0

NULL seems to work also. Interesting to know.

Is this one "crapperquotes housemade problem"? I don't know. :mrgreen:
Crapperquotes homemade problem indeed !

It seems changing back to the old fashioned POINT MULTIPLIER works a charm.

May be that is why the old ea like Fratelli using pending orders works without any problem because it uses the old fashioned point multiplier.

Code: Select all

    //Adapt to x digit criminals   //fx8000 mod
   int multiplier = 1;
   if(Digits == 2 || Digits == 4) multiplier = 1;
   if(Digits == 3 || Digits == 5) multiplier = 10;
   if(Digits == 6) multiplier = 100;   
   if(Digits == 7) multiplier = 1000;   
   
   if (multiplier > 1) PipDescription = " points";
   
   TakeProfitPips*= multiplier;
   StopLossPips*= multiplier;
   //HiddenPips*= multiplier;
   BufferPips*= multiplier;
   //MaxSpread *= multiplier;
You do not have the required permissions to view the files attached to this post.
User avatar
fxdaytrader
Trader
Posts: 190
Joined: Sun Jun 10, 2012 7:03 am
Location: Poon-Town (germany, se-asia, se-europe) ...

Re: HELP WITH ERROR 130 FOR PENDING ORDER SCRIPT

Post by fxdaytrader »

You forgot the "Point", look in my version ;) -

Code: Select all

      int digits = MarketInfo(NULL,MODE_DIGITS);
      int multiplier=1;
      if(digits==2 || digits==3 || digits==5) multiplier = 10;
      if(digits==6) multiplier = 100;
      if(digits==7) multiplier = 1000;
      pips2dbl = MarketInfo(NULL,MODE_POINT) * multiplier;
     
     stop = NormalizePrice(Symbol(),StopLossPips*pips2dbl);
     take = NormalizePrice(Symbol(),TakeProfitPips*pips2dbl);
And there is it where we got the problem - MarketInfo(Symbol() ... did not work, but MarketInfo(OrderSymbol() did it, as well as MarketInfo(NULL,...

It is tricky, I read that some brokers does not return values for MarketInfo+Digits, so maybe we have to check also if there is something returned and if not then use the simple Point/Digits (what would not work in multipair EAs) ... :mrgreen:

btw - If I considered my broker as a "criminal", I would not hesitate to change the broker. :mrgreen:

edit: In "our" pending-orders version of bob and shelley again EA I will implement the choice whether to use the pipfactor-stuff or the pips2dbl-things. It should not be tricky to implement that, if use pips2dbl we must set factor=1 and calculate the pips2dbl-stuff in the init section. I will do it within the next update
Last edited by fxdaytrader on Thu Aug 22, 2013 9:02 am, edited 1 time in total.
Post Reply

Return to “Coders Hangout”