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

Scalping New York
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=6189
Page 19 of 31
Author:  biobier [ Fri Jun 03, 2022 11:56 am ]
Post subject:  Scalping New York

I have this issue only on my slow (busy) development system. I think that is the reason why only some ppl have that issue. The others run a proper sized system :P

However there still is something more than the previous error... Created a test script (attached).
See this part of the output especially the time for CADCHF:

Code: Select all

0	13:42:09.307	GetBarDetails AUDUSD,M5: Details last bar for AUDUSD 15: Time=2022.06.03 14:15:00, Open=0.7243000000000001, High=0.72514, Low=0.7242499999999999, Close=0.72484, Volume=1047
0	13:42:09.320	GetBarDetails AUDUSD,M5: Details last bar for CADCHF 15: Time=2022.04.28 12:45:00, Open=0.75662, High=0.7571099999999999, Low=0.75621, Close=0.7569900000000001, Volume=1800
0	13:42:09.336	GetBarDetails AUDUSD,M5: CADCHF Got error (4066): requested history data is in update state Will etry
0	13:42:09.336	GetBarDetails AUDUSD,M5: Details last bar for CADCHF 15: Time=2022.04.28 12:45:00, Open=0.75662, High=0.7571099999999999, Low=0.75621, Close=0.7569900000000001, Volume=1800
0	13:42:09.336	GetBarDetails AUDUSD,M5: Details last bar for CADJPY 15: Time=2022.06.03 14:15:00, Open=103.481, High=103.534, Low=103.466, Close=103.514, Volume=1720
Time=2022.04.28 12:45:00 WTF? 14:15 is the right one. Running the script again that symbol get the right time. Feel free to play around with the script. But I think we are getting closer....
Author:  lemur6666 [ Fri Jun 03, 2022 1:46 pm ]
Post subject:  Scalping New York

I just thought of a work around . What if we took close of previous M5 candle and refer ourselves to the open 12 candles back. It will not be H1, but its close enough. Or M1 candle with reference to 60 candles back... Either way we should have our historical candles on M5/M1 by the time scalpy needs them. :idea:
Author:  pivotter [ Fri Jun 03, 2022 2:08 pm ]
Post subject:  Scalping New York

i was thinking of another approach , collect the bid prices of all pairs and store them at open time minus 1 hour and compare that.

Still this problem can better be inspected till it is solved as it has consequences on every use of iOpen and iClose.
Author:  FundedCoffee [ Fri Jun 03, 2022 3:26 pm ]
Post subject:  Scalping New York

celte83 » Fri Jun 03, 2022 4:20 am wrote:Salut,
One more chance: I haven't been called a moron. Not yet. :D :D :D . Maybe is it the "single malt" effect ...

Idea for a breakeven settings for scalpy sounds like it makes a lot of sense, especially when you are a few cents away from the goal and you end up with a loss of twice the goal. And only one option It seems so obvious for experienced people... but ... I shut up,
thank you Sir

:hi:
jf
and then you are going to have times where price hits your Target, but you only got a breakeven.

breakeven always sounds like it makes a lot of sense. Why? Because we dont like losing. More of than not taking losses is much more profitable in the long run though.

We are trading with a bot, we have the benefit of not needing to be in front of the charts, not needing to look at the current open trade, not needing to watch how our balance is in drawdown.

Use it to your advantage.
Author:  SteveHopwood [ Fri Jun 03, 2022 6:58 pm ]
Post subject:  Scalping New York

biobier » Fri Jun 03, 2022 8:02 am wrote:Spotted that in function testForAlreadyTradedThisHour it is checked for all orders (not for our magicnumber only)

Code: Select all

      if (OrderMagicNumber() != MagicNumber) continue;
Need to be added.
The reason I did not bother with this in the first place is that Scalpy is a whole position basket trader. Only an idiot then tries other strategies at the same time.

Leaving out the magic number check is a protection measure for the dimwits - and a deliberate one.

:xm: :rocket:
Author:  SteveHopwood [ Fri Jun 03, 2022 7:01 pm ]
Post subject:  Scalping New York

biobier » Fri Jun 03, 2022 10:57 am wrote:I think I found the issue with the wrong direction.
I've added error check after the call to iClose/iOpen and got:
Scalpy EURAUD,M15: getDirection AUDNZD Scalpy error(4066): requested history data is in update state
So I suggest we check for errors 4066/4073 and try again untill there is no error.

I suggest to wrap this in a helper function for reusabilty:

Code: Select all

double iiOpen(string symbol,int  timeframe,  int shift){
   GetLastError();//reset possible uncatched error
   double copen=iOpen(symbol, timeframe, shift);
   int err=GetLastError();
   while (closeEnough(copen, 0) || err>0){
      copen = iOpen(symbol, timeframe, shift);
      err=GetLastError();
      if(err>0) Sleep(10);
   }
   return copen;
}
double iiClose(string symbol,int  timeframe,  int shift){
   GetLastError();//reset possible uncatched error
   double cclose=iClose(symbol, timeframe, shift);
   int err=GetLastError();
   while (closeEnough(cclose, 0) || err>0){
      cclose = iClose(symbol, timeframe, shift);
      err=GetLastError();
      if(err>0) Sleep(10);
   }
   return cclose;
}
Fantastic again. Unbelievable. Stunning. :clap: :clap: :clap: :clap: :clap: :clap: :clap:

Consider this done. I will make the update tomorrow.

:xm: :rocket:
Author:  SteveHopwood [ Fri Jun 03, 2022 7:18 pm ]
Post subject:  Scalping New York

I decided to make the changes offered by biobier immediately, so the latest version is attached here, so you folks can check the code (not his - mine). I will make this the post 1 version before the markets open after the weekend.

You will find biobier's latest iiOpen() etc functions immediately above OnTimer(). I have made the requisite edits to void getDirection(string symbol, int tf, int pairIndex)

I am still thinking about adding the magic number check.

:xm: :rocket:
Author:  SteveHopwood [ Fri Jun 03, 2022 7:26 pm ]
Post subject:  Scalping New York

pivotter » Fri Jun 03, 2022 2:08 pm wrote:i was thinking of another approach , collect the bid prices of all pairs and store them at open time minus 1 hour and compare that.

Still this problem can better be inspected till it is solved as it has consequences on every use of iOpen and iClose.
Imaginative, or what? :clap: :clap: :clap: :clap: :clap: :clap: :clap:

As you say, better if we can solve the problem but your idea is something to bear in mind. Please store it somewhere safely so you do not forget it, in case we have to resort to it.

:xm: :rocket:
Author:  SteveHopwood [ Fri Jun 03, 2022 7:34 pm ]
Post subject:  Scalping New York

I am looking at demo results for the two accounts I have listed in post 1. Istarted the dynamic TP demo on 4th April 2022. Comparing the profitability of the two over the same time period:
  • Dynamic TP: +$634
    '
  • Hard' tp of $100: +$585
Not a lot of difference so too early to draw conclusions.

One thingy we can say with confidence is: this is damn good fun. :clap: :clap: :clap: :clap: :clap: :clap:

:xm: :rocket:
Author:  SteveHopwood [ Fri Jun 03, 2022 7:41 pm ]
Post subject:  Scalping New York

One final one from me tonight.

Today was NFP; I advised people to stay out of the markets and did so myself live. I left the demos running.

My London baskets closed at BE +$44 (0.1 lots).

Both NY baskets hit their TP within an hour or so of opening - the dynamic TP being $120.

:xm: :rocket:
All times are UTC Page 19 of 31