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

Scalping New York
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=6189
Page 10 of 31
Author:  sangratan [ Wed May 25, 2022 2:45 pm ]
Post subject:  Scalping New York

I don't understand
Author:  TableTop [ Wed May 25, 2022 3:10 pm ]
Post subject:  Scalping New York

sangratan » Wed May 25, 2022 2:45 pm wrote:nothing happens ,it doesn't work
Strange - could it be a data issue? I've found that if I get this type of issue and open each chart, and click on a few timeframes it seems to re-boot the data feed. I do have it working fine on 3 instances so I don't think it can be a code issue.
Author:  sangratan [ Wed May 25, 2022 3:23 pm ]
Post subject:  Scalping New York

the strange thing is that yesterday the first version (with no BE and Closures ) worked perfectly
Author:  pivotter [ Wed May 25, 2022 3:27 pm ]
Post subject:  Scalping New York

I think this is the reason for not opening:

In testForAlreadyTradedThisHour()

Add the last 3 lines to the code, the Ea wont open if it finds trades in the same hours in previous days

for (int cc = OrdersHistoryTotal() - 1; cc >= 0; cc--)
{
if (!BetterOrderSelect(cc, SELECT_BY_POS, MODE_HISTORY) )
continue;//Shouldn't happen, but no harm in making sure

if (TimeDay(OrderOpenTime()) != TimeDay(TimeLocal()))continue;
if (TimeMonth(OrderOpenTime()) != TimeMonth(TimeLocal()))continue;
if (TimeYear(OrderOpenTime()) != TimeYear(TimeLocal()))continue;
Author:  sangratan [ Wed May 25, 2022 3:58 pm ]
Post subject:  Scalping New York

Wow...... :yahoo: :yahoo: :yahoo: :yahoo: :yahoo: :yahoo: :youknow: :youknow: :youknow: :youknow: :youknow:
you are a magician.....
In these moments I wuold be a coder to understand how is it possible to fix ....
wonderful
many,many thanks
I 'll look if all it's right in the first session
thanks again
Author:  sangratan [ Wed May 25, 2022 4:45 pm ]
Post subject:  Scalping New York

:arrrg: :arrrg: :arrrg: :arrrg: :arrrg:
noooo,
after closed the first TP it stop working and now I am not able to start it again
grrrr
Author:  SteveHopwood [ Wed May 25, 2022 4:55 pm ]
Post subject:  Scalping New York

pivotter » Wed May 25, 2022 3:27 pm wrote:I think this is the reason for not opening:

In testForAlreadyTradedThisHour()

Add the last 3 lines to the code, the Ea wont open if it finds trades in the same hours in previous days

for (int cc = OrdersHistoryTotal() - 1; cc >= 0; cc--)
{
if (!BetterOrderSelect(cc, SELECT_BY_POS, MODE_HISTORY) )
continue;//Shouldn't happen, but no harm in making sure

if (TimeDay(OrderOpenTime()) != TimeDay(TimeLocal()))continue;
if (TimeMonth(OrderOpenTime()) != TimeMonth(TimeLocal()))continue;
if (TimeYear(OrderOpenTime()) != TimeYear(TimeLocal()))continue;
The joy of free, open source coding. Thanks Ben. You are a star. :clap: :clap: :clap: :clap: :clap:

I had not experienced this issue because I was only maintaining today's orders in my history tab. I have added Ben's fix and added the update to post 1.

DIYers, do a search for:
if (closeHour == hourBroker)

Add this underneath the return(true);//Yes, so no more trading until a new H1 candle forms. command/statement:

Code: Select all

      /*We have pivotter (Ben) to thank for spotting why Scalpy would stop
        trading altogether. Go to https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=174598#p174598
        to read his post.
        
        Ben also supplied the code. Break out of the loop as soon
        as we find an order that was not sent today - broker time
      */   
      if (TimeDay(OrderOpenTime()) != TimeDay(TimeCurrent())) break;
      if (TimeMonth(OrderOpenTime()) != TimeMonth(TimeCurrent())) break;
      if (TimeYear(OrderOpenTime()) != TimeYear(TimeCurrent())) break;
Please include the comment just in case you share the code elsewhere - you all know by now that I like to acknowledge the contributions of other coders.

:xm: :rocket:
Author:  sangratan [ Wed May 25, 2022 5:09 pm ]
Post subject:  Scalping New York

:hi: :hi: :hi:
It seems that it works without problems.....
fingers crossed and silence .....I'll see going on
thanks for your help
Author:  SteveHopwood [ Wed May 25, 2022 5:14 pm ]
Post subject:  Scalping New York

The earlier bloops with BE and auto-close cost the demo just over $1,000.

Since the fixes:
  • TP $30
  • BE wait time 1 hour
  • Auto-close 2 hours
None of the non-TP closures needed. 7 baskets closed at TP when I started writing this and an 8'th whilst typing.

Are we onto something here?

:xm: :rocket:
Author:  SteveHopwood [ Wed May 25, 2022 5:17 pm ]
Post subject:  Scalping New York

sangratan » Tue May 24, 2022 2:25 pm wrote:Hi Steve......thanks for your jewel......
the power of CSS 's strenght togheter with MS is incredible ,
practically a machine gun following mostly currencie's strenght...
thanks again
I am not ignoring this - let's get the basics correct first.

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