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

Scalping New York
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=6189
Page 21 of 31
Author:  SteveHopwood [ Sat Jun 04, 2022 2:09 pm ]
Post subject:  Scalping New York

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:
Author:  pivotter [ Sat Jun 04, 2022 2:42 pm ]
Post subject:  Scalping New York

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
Author:  tomele [ Sat Jun 04, 2022 3:04 pm ]
Post subject:  Scalping New York

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.
Author:  SteveHopwood [ Sat Jun 04, 2022 7:38 pm ]
Post subject:  Scalping New York

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:
Author:  SteveHopwood [ Sat Jun 04, 2022 7:45 pm ]
Post subject:  Scalping New York

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

:xm: :rocket:
Author:  tomele [ Sat Jun 04, 2022 10:33 pm ]
Post subject:  Scalping New York

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();
   
   ...
}

Author:  SteveHopwood [ Sun Jun 05, 2022 12:36 pm ]
Post subject:  Scalping New York

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:
Author:  SteveHopwood [ Sun Jun 05, 2022 3:01 pm ]
Post subject:  Scalping New York

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:
Author:  getdown71 [ Mon Jun 06, 2022 1:08 am ]
Post subject:  Scalping New York

Morning all,

Looks like Scalpy is maturing well!

Muchas kudos to the collab here.

Cheers,

Nick
Author:  Aussie Phil [ Mon Jun 06, 2022 2:31 am ]
Post subject:  Scalping New York

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
All times are UTC Page 21 of 31