Scalping New York

Post Reply
Umberleigh
Posts: 3
Joined: Sun Feb 20, 2022 2:16 am

Scalping New York

Post by Umberleigh »

Scalpy is doing a great job
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.

Scalping New York

Post by SteveHopwood »

pivotter » Wed Jun 01, 2022 3:35 pm wrote:we always assume that per request all data is correctly retrieved, but if from iClose or iOpen the retrieved value is a zero instead of the correct value you would also get a wrong candle direction.

We can test it with print the retrieved values.
Another great idea Ben. :clap: :clap: :clap: :clap: :clap: I can code this into Scalpy to force him tokeep on trying until a non-zero value is returned.

:xm: :rocket:
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.

Scalping New York

Post by SteveHopwood »

So far as I know, this only works for the chart hosting the EA/script. I tried this in my Experiments script to see if the function could be called with a parameter:

Code: Select all

void OnStart()
{

   string symbol = "EURUSD";
   RefreshRates(symbol); 
}
It threw up an error.

:xm: :rocket:
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
pivotter
Trader
Posts: 38
Joined: Sun May 01, 2016 12:02 am
Location: The Hague, The Netherlands

Scalping New York

Post by pivotter »

SteveHopwood » Wed Jun 01, 2022 4:49 pm wrote:
pivotter » Wed Jun 01, 2022 3:35 pm wrote:we always assume that per request all data is correctly retrieved, but if from iClose or iOpen the retrieved value is a zero instead of the correct value you would also get a wrong candle direction.

We can test it with print the retrieved values.
Another great idea Ben. :clap: :clap: :clap: :clap: :clap: I can code this into Scalpy to force him tokeep on trying until a non-zero value is returned.

:xm: :rocket:

i would also change:
line 390 (cclose > copen) to (cclose >= copen)
line 396 (cclose < copen) to (cclose <= copen)
typical Empty4 , sometimes it starts working after adding the equal sign,

Also on line 1466 and 1467
type = OP_SELL;
price = bid;

pls move them 3 lines up before the MA240 check to give them time to switch before the value is send in sendSingleTrade(
You think the rumbling comes from our "magic" black-box ?
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.

Scalping New York

Post by SteveHopwood »

pivotter » Wed Jun 01, 2022 4:58 pm wrote:
SteveHopwood » Wed Jun 01, 2022 4:49 pm wrote:
pivotter » Wed Jun 01, 2022 3:35 pm wrote:we always assume that per request all data is correctly retrieved, but if from iClose or iOpen the retrieved value is a zero instead of the correct value you would also get a wrong candle direction.

We can test it with print the retrieved values.
Another great idea Ben. :clap: :clap: :clap: :clap: :clap: I can code this into Scalpy to force him tokeep on trying until a non-zero value is returned.

:xm: :rocket:

i would also change:
line 390 (cclose > copen) to (cclose >= copen)
line 396 (cclose < copen) to (cclose <= copen)
typical Empty4 , sometimes it starts working after adding the equal sign,

Also on line 1466 and 1467
type = OP_SELL;
price = bid;

pls move them 3 lines up before the MA240 check to give them time to switch before the value is send in sendSingleTrade(
Thanks again. I do not see how this would help.
Also on line 1466 and 1467
type = OP_SELL;
price = bid;

pls move them 3 lines up before the MA240 check to give them time to switch before the value is send in sendSingleTrade
Doesn't mean it will not help - just that I do not see how.

Re this:
i would also change:
line 390 (cclose > copen) to (cclose >= copen)
line 396 (cclose < copen) to (cclose <= copen)
typical Empty4 , sometimes it starts working after adding the equal sign,
Definitely and already made the change. It made me think that I have declared cclose ets as a double - legacy code from years ago. Do you think this should be a 'datetime' instead? Or merely an integer?

:xm: :rocket:
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.

Scalping New York

Post by SteveHopwood »

I just answered my own question about the cclose etc declaration by putting this into my Experiments script:

Code: Select all

void OnStart()
{

   datetime x =TimeLocal();
   Alert(x);
 
}
Worked perfectly, so I will make that change.

:xm: :rocket:
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
pivotter
Trader
Posts: 38
Joined: Sun May 01, 2016 12:02 am
Location: The Hague, The Netherlands

Scalping New York

Post by pivotter »

SteveHopwood » Wed Jun 01, 2022 5:10 pm wrote:
pivotter » Wed Jun 01, 2022 4:58 pm wrote:
SteveHopwood » Wed Jun 01, 2022 4:49 pm wrote:
pivotter » Wed Jun 01, 2022 3:35 pm wrote:we always assume that per request all data is correctly retrieved, but if from iClose or iOpen the retrieved value is a zero instead of the correct value you would also get a wrong candle direction.

We can test it with print the retrieved values.
Another great idea Ben. :clap: :clap: :clap: :clap: :clap: I can code this into Scalpy to force him tokeep on trying until a non-zero value is returned.

:xm: :rocket:

i would also change:
line 390 (cclose > copen) to (cclose >= copen)
line 396 (cclose < copen) to (cclose <= copen)
typical Empty4 , sometimes it starts working after adding the equal sign,

Also on line 1466 and 1467
type = OP_SELL;
price = bid;

pls move them 3 lines up before the MA240 check to give them time to switch before the value is send in sendSingleTrade(
Thanks again. I do not see how this would help.
Also on line 1466 and 1467
type = OP_SELL;
price = bid;

pls move them 3 lines up before the MA240 check to give them time to switch before the value is send in sendSingleTrade
Doesn't mean it will not help - just that I do not see how.

Re this:
i would also change:
line 390 (cclose > copen) to (cclose >= copen)
line 396 (cclose < copen) to (cclose <= copen)
typical Empty4 , sometimes it starts working after adding the equal sign,
Definitely and already made the change. It made me think that I have declared cclose ets as a double - legacy code from years ago. Do you think this should be a 'datetime' instead? Or merely an integer?

:xm: :rocket:
iClose is a double see https://docs.mql4.com/series/iclose
You think the rumbling comes from our "magic" black-box ?
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.

Scalping New York

Post by SteveHopwood »

Thanks. Yet again pointing the way forward. :clap: :clap: :clap: :clap: :clap:

:xm: :rocket:
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.

Scalping New York

Post by SteveHopwood »

Thanks to Ben, the latest version attempting to Battle Empty4 Anomalies is in post 1.

Code checkers and DIYers, copy these over the top of the existing functions. You can see how I have used our closeEnough() function to ensure that we are not comparing bid/ask values with zero.

Newcomers to all this, remember to right click Scalpy in your Navigator window and delete him, close down your platform and then download the update from post 1. Empty4 will only recompile .mq4 source code on restarting if the .ex4 file is missing.

Code: Select all

void getDirection(string symbol, int tf, int pairIndex)
{

   //Ascertain the direction of movement of the previous candle
   
   double copen = 0;
   double cclose = 0;
   
   while (closeEnough(copen, 0) )
      copen = iOpen(symbol, tf, 1);
   
   while (closeEnough(cclose, 0) )
      cclose = iClose(symbol, tf, 1);
   
   direction = noney;//Default, and unlikely to happen but does sometimes
   if (cclose > copen)
   {
      direction = longy;
      return;
   }//if (cclose > copen)
   
   if (cclose < copen)
   {
      direction = shorty;
      return;
   }//if (cclose > copen)
   

}//End void getDirection(string symbol, int tf, int pairIndex)

bool confirmLongSignal(string symbol, int pairIndes)
{

   //Bob's moving average filter
   getBasics(symbol);//Probably notnecessary, but this is Empty4 we are battling with
   MaVal = 0;
   while (closeEnough(MaVal, 0) )
      MaVal = GetMa(symbol, MaTF, MaPeriod, MaShift, MaMethod, MaAppliedPrice, 0);
         
   //MaVal is no longer == 0, so we can continue
   if (ask < MaVal) 
      return(false);   

   //Got here, so ok to send the order
   return(true);

}//End bool confirmLongSignal(string symbol, int pairIndes)


bool confirmShortSignal(string symbol, int pairIndes)
{

   //Bob's moving average filter
   getBasics(symbol);
   MaVal = 0;
   while (closeEnough(MaVal, 0) )
      MaVal = GetMa(symbol, MaTF, MaPeriod, MaShift, MaMethod, MaAppliedPrice, 0);
      
   //MaVal is no longer == 0, so we can continue   
   if (bid > MaVal) 
      return(false);   


   
   //Got here, so ok to send the order
   return(true);

}//End bool confirmShortSignal(string symbol, int pairIndes)

:xm: :rocket:
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.

Scalping New York

Post by SteveHopwood »

Now is as good a time as any to remind/tell people how SHF is a hugely cooperative forum.

Yes, it is my name at the top but we are only so successful because of the contributions of countless others. Read my code and you will see my written appreciation of the contributions of so many coders over the years - some of whom have forgotten more about coding than I will ever learn.

I am not going to name names here because I forget names and will inevitably leave people out. You know who you are - you are members of my Elite group here.

Not everyone who makes/made fantastic contributions are members of the Elite. This does not make you any the less invaluable.

Onwards and upwards.

:xm: :rocket:
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.
Post Reply

Return to “Automated trading systems”