Scalping New York

Post Reply
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 »

Scalpy suddenly started trying to send orders even though the markets are closed. Disable experts for now or you will have some massive log files.

: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 » Sat Jun 04, 2022 1:37 pm wrote:
pivotter » Fri Jun 03, 2022 8:46 pm wrote:but i also cheated as i added ForceLoadHistoricalData() to the top of sendBasket() to make sure all H! and H4 candles are updated before all symbols are scanned,
That is a great idea. Can you post the code please, so I can add it?

:xm: :rocket:
Sure, attached the Scalpy with ForceloadHistory.
2 lines are added to the top of sendBasket()

//All symbols in marketpanel
ForceLoadHistoricalData();
Sleep(120000);//sleep 2 min so Empty4 can update the history file

You might want to set TradingWaitMinutes=3; to compensate for the 2 waiting minutes,

The 3 required functions, adapted to load only H1 and H4 in this case are at the bottom of the file.
void ForceLoadHistoricalData()
bool ForceLoadOneSym(
int barsWithRetry(
//---------


The file was updated to fix a bug that prevented it from trading on June 7

Ben
You do not have the required permissions to view the files attached to this post.
Last edited by pivotter on Tue Jun 07, 2022 8:36 am, edited 5 times in total.
You think the rumbling comes from our "magic" black-box ?
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Scalping New York

Post by tomele »

Yes Steve, correct.

Only thing that can happen is a delay between adding the symbol to the market watch list and this symbols quotes being completely up-to-date. If you place it just before evaluating the data series, you might probably still get wrong data in the first pass.

You could do the following to skip this pass for a symbol that got just added:

Code: Select all

   if(!SymbolInfoInteger(symbol,SYMBOL_SELECT))
   {  SymbolSelect(symbol,true);
      continue;
   }
All those other workarounds might cause more problems than they solve.
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
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 »

tomele » Sat Jun 04, 2022 3:04 pm wrote:Yes Steve, correct.

Only thing that can happen is a delay between adding the symbol to the market watch list and this symbols quotes being completely up-to-date. If you place it just before evaluating the data series, you might probably still get wrong data in the first pass.

You could do the following to skip this pass for a symbol that got just added:

Code: Select all

   if(!SymbolInfoInteger(symbol,SYMBOL_SELECT))
   {  SymbolSelect(symbol,true);
      continue;
   }
All those other workarounds might cause more problems than they solve.
I am starting to agree with you - who would not? I have removed the code I posted earlier and that you quote.

The one change I have made is to add code to move a pair to the Market Watch window from within the extractPairs() function, should it not be there already. extractPairs() is called from within OnInit() and converts our PairsToTrade input into an array that the code can use.

Here is the updated function so you bloop spotters can spot any bloops.

Code: Select all

void extractPairs()
{
   
  
   int pairIndex = 0;
   
   //Read the pairs into a temporary array so that 
   //pairs not offered by the broker are removed.
   string tempTradePair[];
   StringSplit(PairsToTrade,',',tempTradePair);
   noOfPairs = ArraySize(tempTradePair);
   int tempIndex = 0;
   string symbol = "";
   
   //Save the pairs offered by the broker into the tradePair array
   //hecking first that the broker offers the pair.
   for (pairIndex = 0; pairIndex < noOfPairs; pairIndex ++)
   {
      symbol = tempTradePair[pairIndex];
      symbol = StringTrimLeft(symbol);
      symbol = StringTrimRight(symbol);
      symbol = StringConcatenate(PairPrefix, symbol, PairSuffix);
      
      getBasics(symbol);//Returns zero for the Bid if the symbol is not offered.
      if (!closeEnough(bid, 0) )
      {
         tempIndex++;
         ArrayResize(tradePair, tempIndex);
         tradePair[tempIndex - 1] = symbol;
         
      }//if (!closeEnough(bid, 0) )
     
   }//for (pairIndex = 0; pairIndex < noOfPairs; pairIndex ++)
   
   noOfPairs = tempIndex;//Not used again in this code, but store it for possible future use.
   


   //Now ensure the user has each of their pairs in the Market Watch window.
   //Most likely they will but hey, why not? We can all make mistakes
   for (pairIndex = 0; pairIndex < ArraySize(tradePair); pairIndex++ )
   {
      //This next command forces the pair into the Market Watch window. I think.
      SymbolSelect(tradePair[pairIndex], true);   
   }//for (pairIndex = 0; pairIndex < ArraySize(tradePair); pairIndex++ )
   

}//void extractPairs()
From here on, I am not going to continue chasing the vagaries of Empty4. So nothing is perfect about Scalpy? I don't care. Ask yourself these questions:
  • Am I making money from my live account trading?
  • Are my demo accounts testing different TP's etc powering ahead?
If the answer to both of those questions is, "Yes," then stop angsting about the imperfections. I do not care.

If the answer to either of them is, "No," then:
  • Change your broker.
  • Change your settings.
Then if you think you can code an 'improvement' then:
  • Do so.
  • Run test demos pitching your new code against the original and report favourable results. Especially you Ben, as you might be onto something useful. It is just that I have been like a hamster on a wheel before and I am too busy teaching these days to play that game. No intended disrespect to you.
I shall be releasing V 1a tomorrow with the amendments I am prepared to make. It occurred to me today that newcomers might not realise that the platform does not automatically recompile edited source code, so updates in the version number should alert them.

None of what I have just written implies any criticism on my part of members who have suggested improvements. It is just that Scalpy is doing rather well, so let's not go chasing rabbits into warrens.

: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 »

By-the-bye. Anyone know the code to stop Scalpy trying to send orders when the markets are shut for the weekend?

: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
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Scalping New York

Post by tomele »

Sure. Check whether the server time is changing. For example:

Code: Select all

datetime lastServerTime;

int OnInit()
{
   lastServerTime=TimeCurrent();

   ...
}

void OnTimer() 
{
   if(!TimeCurrent()>lastServerTime) return;
   lastServerTime=TimeCurrent();
   
   ...
}

Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
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 »

tomele » Sat Jun 04, 2022 10:33 pm wrote:Sure. Check whether the server time is changing. For example:

Code: Select all

datetime lastServerTime;

int OnInit()
{
   lastServerTime=TimeCurrent();

   ...
}

void OnTimer() 
{
   if(!TimeCurrent()>lastServerTime) return;
   lastServerTime=TimeCurrent();
   
   ...
}

Thanks Thomas. I should have worked that out for myself. :arrrg:

: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 »

V 1a is in post 1. Check that your download and recompilation has worked by looking at the version display underneath the time and date display.

I have added a step by step guide to installing updates in post 1.

: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.
getdown71
Trader
Posts: 15
Joined: Wed Nov 16, 2011 11:12 pm

Scalping New York

Post by getdown71 »

Morning all,

Looks like Scalpy is maturing well!

Muchas kudos to the collab here.

Cheers,

Nick
Aussie Phil
Posts: 9
Joined: Tue Dec 06, 2011 9:05 am

Scalping New York

Post by Aussie Phil »

I rarely post less than 1 post per year over the last 10 years tells the story but I feel compelled.... My results from last week are exciting.

GP fresh demo $200
OOTB session times
.01 lots
$5.00 fixed TP
Net profit 11.2%

What needs to be taken into account is that Scalpy is a basket trader and a small $200 account will only allow 5 trades to open, of course that increases/decreases as the balance changes. Early days I know but my point is smaller lot sizes and target and still this simple and sound strategy delivered. No indicators, no gambling on mumbo jumbo, no bullshit.

Thanks Steve et al
Post Reply

Return to “Automated trading systems”