Scalping New York
- sangratan
- Trader
- Posts: 56
- Joined: Thu Feb 24, 2022 9:39 am
- Location: Pisa
Scalping New York
Thank you Steve for your work here.... :hi:

-
wallywonka
- Trader
- Posts: 188
- Joined: Thu May 12, 2016 7:46 am
Scalping New York
Nice work Steve!

- 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
I am nearly there.
This one is for the coders. Imagine MS sent a basket at 1.05 and your AutomaticStartCloseHour input is 4. This means you want the closure of a failed basket to happen at 5.00.
This expression results in a closure time of 5.05:
datetime autoCloseStarts = OrderOpenTime() + (3600 * AutomaticStartCloseHour);
Any ideas for losing the 5 minutes?

This one is for the coders. Imagine MS sent a basket at 1.05 and your AutomaticStartCloseHour input is 4. This means you want the closure of a failed basket to happen at 5.00.
This expression results in a closure time of 5.05:
datetime autoCloseStarts = OrderOpenTime() + (3600 * AutomaticStartCloseHour);
Any ideas for losing the 5 minutes?
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.
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.
-
lemur6666
- Trader
- Posts: 69
- Joined: Mon Nov 27, 2017 8:29 am
Scalping New York
Steve,
I played with them TimeToStruct / StructToTime before.
But before I sit down to code it pls clarify : if you opened order at 1:55 and your AutomaticStartCloseHour input is 4 than you want to close it at 5:00 or 6:00 ? In other words you want to round minutes down to full hour, correct ? I can imagine rouding up passed xx:30 and rounding down below 00:29 ...
I played with them TimeToStruct / StructToTime before.
But before I sit down to code it pls clarify : if you opened order at 1:55 and your AutomaticStartCloseHour input is 4 than you want to close it at 5:00 or 6:00 ? In other words you want to round minutes down to full hour, correct ? I can imagine rouding up passed xx:30 and rounding down below 00:29 ...
-
Maximilian
- Trader
- Posts: 150
- Joined: Sat Sep 06, 2014 2:43 pm
Scalping New York
Maybe too simple but couldn´t be a quick and dirty solution to reduce the 3600 seconds by the offset minutes in seconds eg.SteveHopwood » Mon May 23, 2022 8:45 am wrote:I am nearly there.
This one is for the coders. Imagine MS sent a basket at 1.05 and your AutomaticStartCloseHour input is 4. This means you want the closure of a failed basket to happen at 5.00.
This expression results in a closure time of 5.05:
datetime autoCloseStarts = OrderOpenTime() + (3600 * AutomaticStartCloseHour);
Any ideas for losing the 5 minutes?
![]()
datetime autoCloseStarts = OrderOpenTime() + (3600 * AutomaticStartCloseHour-(TradingMinutes*60));
?
Greetings Max
- 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
Thanks again Max. The same solution came to me in the car on the way home from school, so we are on the right track.Maximilian » Mon May 23, 2022 2:51 pm wrote:Maybe too simple but couldn´t be a quick and dirty solution to reduce the 3600 seconds by the offset minutes in seconds eg.SteveHopwood » Mon May 23, 2022 8:45 am wrote:I am nearly there.
This one is for the coders. Imagine MS sent a basket at 1.05 and your AutomaticStartCloseHour input is 4. This means you want the closure of a failed basket to happen at 5.00.
This expression results in a closure time of 5.05:
datetime autoCloseStarts = OrderOpenTime() + (3600 * AutomaticStartCloseHour);
Any ideas for losing the 5 minutes?
![]()
datetime autoCloseStarts = OrderOpenTime() + (3600 * AutomaticStartCloseHour-(TradingMinutes*60));
?
Greetings Max
MS is not quite ready yet. I just saw him close a basket at TP, then immediately send a fresh one - something we do not want. There is a function to prevent this but it is not working yet.
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.
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.
- 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
Multiple Scalpy is in post 1. Scroll down to my usual sign off for details.
There may be bugs, so keep an eye out for inconsistencies.

There may be bugs, so keep an eye out for inconsistencies.
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.
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.
- 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
I left MS running from 1 AM to 5 PM, shooting for a TP of $30 (0.1 lots) to generate lots of closures. This has been ridiculously successful, generating a profit of $300.
The problem of MS sending a fresh basket as soon as closing at TP persists and it is driving me nuts.
The last code block before sending the orders is this:
The function it calls is this:
Can any of you bloop spotters see why it does not work?

The problem of MS sending a fresh basket as soon as closing at TP persists and it is driving me nuts.
The last code block before sending the orders is this:
Code: Select all
//We are in a trading hour, so test for a basket having been sent
//and hitting TP within the hour
//The function returns 'true' if it finds an order that opened
//or closed during the hour, else returns 'false'
if (testForAlreadyTradedThisHour() )
{
displayUserFeedback();
return;
}//if (testForAlreadyTradedThisHour() )Code: Select all
bool testForAlreadyTradedThisHour()
{
//The function returns 'true' if it finds an order that opened
//or closed during the hour, else returns 'false'
if (OrdersHistoryTotal() == 0)
return(false);
int hourBroker = TimeHour(TimeCurrent() );
for (int cc = OrdersHistoryTotal() - 1; cc >= 0; cc--)
{
if (!betterOrderSelect(SELECT_BY_POS, MODE_TRADES, MODE_HISTORY) )
continue;//Shouldn't happen, but no harm in making sure
//Did the order open during the current hour?
int openHour = TimeHour(OrderOpenTime() );
if (openHour == hourBroker)
return(true);//Yes, so already traded this hour
//Did the order close during the current hour?
int closeHour = TimeHour(OrderCloseTime() );
if (closeHour == hourBroker)
return(true);//Yes, so no more trading until a new H1 candle forms.
}//for (int cc = OrdersHistoryTotal() - 1; cc >= 0; cc--)
//Reached here, so OK to trade
return(false);
}//End bool testForAlreadyTradedThisHour()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.
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.
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
Scalping New York
Hi Steve.
Look at the arguments of betterOrderSelect.
Cheers
Look at the arguments of betterOrderSelect.
Cheers
Happy pippin, Thomas 
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
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
- 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
Oops.tomele » Tue May 24, 2022 10:10 am wrote:Hi Steve.
Look at the arguments of betterOrderSelect.
Cheers
I will post the fix later. For DIYers, the code should be:
if (!betterOrderSelect(SELECT_BY_POS, MODE_HISTORY) )
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.
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.