Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Trades count
Updated August 21, 2022
trending_up
3,224 views
thumb_up
4 thanks given
group
2 followers
forum
11 posts
attach_file
0 attachments
Trades count
August 19th, 2022, 03:28 AM
Bucharest, Romania
Posts: 71 since Mar 2022
Thanks Given: 38
Thanks Received: 22
Hi, I would like to stop my strategy from trading if X happens. e.g, if the High of the previous day is violated before the specified time window, I do not want to take any trade during that specific day.
I tried the following solution without any result:
Code
//15-minute chart and Daily as Data2
input: StartTime(200);
var: ET(0);
ET = Entriestoday(date[0]);
if close > High[1] of Data2 and Time < StartTime then ET = 1 // increase Entriestoday(date[0]) by 1 if that happened before 2am
// Entry
if Entriestoday(date[0]) < 1 and Time > StartTime then // if the previous daily high was not violated, Entriestoday(date[0]) should be < 1 hence take the trade
{insert entry rules};
Let me know, thank you.
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
August 19th, 2022, 12:58 PM
Philadelphia PA
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
Posts: 344 since Jan 2019
Thanks Given: 20
Thanks Received: 146
soacm
ET = Entriestoday(date[0]);
Where did you find out about EntriesToday ? It's not in the MC Wiki , not in the Powerlanguage PDF either.
August 19th, 2022, 01:00 PM
Bucharest, Romania
Posts: 71 since Mar 2022
Thanks Given: 38
Thanks Received: 22
syswizard
Where did you find out about EntriesToday ? It's not in the MC
Wiki , not in the Powerlanguage PDF either.
TradeStation
August 19th, 2022, 01:16 PM
Philadelphia PA
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
Posts: 344 since Jan 2019
Thanks Given: 20
Thanks Received: 146
soacm
Ah....it's not in Multicharts . Sorry, can't help you then.
August 19th, 2022, 02:35 PM
Bucharest, Romania
Posts: 71 since Mar 2022
Thanks Given: 38
Thanks Received: 22
syswizard
Ah....it's not in
Multicharts . Sorry, can't help you then.
Any solution is fine as long as it does the same job.
August 19th, 2022, 04:49 PM
Philadelphia PA
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
Posts: 344 since Jan 2019
Thanks Given: 20
Thanks Received: 146
You could use "TotalTrades" if your Instrument settings are set for the current day only.
Otherwise, you must roll your own since the built-in function is not working.
Vars:
vMP(0)
,cCntr(0)
;
vMP = MarketPosition;
If Time > Sess1FirstBarTime and Time[1] < Sess1FirstBarTime Then
vCntr = Iff(vMP <>0,1,0); ///initialize at start of trading
vCntr = Iff(vMP <> vMP[1],vCntr+1,vCntr); // increment if a new position is taken
So put this into a function and return the vCntr variable value.
August 19th, 2022, 05:30 PM
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360
if the High of the previous day is violated before the specified time window, I do not want to take any trade during that specific day.
input: timew(1000);
var : CanTrade(True);
if date<>date[1] then CanTrade=True; //resets at midnight every new day
If high>close[1] of data2 and time<timew then CanTrade=False;
If CanTrade and {your criteria} then buy next bar at market;
August 20th, 2022, 04:37 AM
Bucharest, Romania
Posts: 71 since Mar 2022
Thanks Given: 38
Thanks Received: 22
kevinkdog
if the High of the previous day is violated before the specified time window, I do not want to take any trade during that specific day.
input: timew(1000);
var : CanTrade(True);
if date<>date[1] then CanTrade=True; //resets at midnight every new day
If high>close[1] of data2 and time<timew then CanTrade=False;
If CanTrade and {your criteria} then buy next bar at market;
Thank you for your replies; @kevinkdog I thought it was the right solution, but still, it executes the trade.
Tried to use Totaltrades which stopped executing the trades after the previous high was violated but stopped executing even other trades that were respecting the rules:
Code
input: StartTime(200);
var: TT(0);
if Date <> Date[1] then
TT = 0;
if Close > High[1] of Data2 and Time < StartTime then TT = 1;
if TT = 0 then
{insert entry rules};
Any other suggestions?
August 20th, 2022, 06:31 AM
Posts: 3,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360
I would use print statements to debug what I wrote. It could be that close[1] of data2 is not what you think.
August 21st, 2022, 08:04 AM
Bucharest, Romania
Posts: 71 since Mar 2022
Thanks Given: 38
Thanks Received: 22
kevinkdog
I would use print statements to debug what I wrote. It could be that close[1] of data2 is not what you think.
It worked, thank you Kevin.
Last Updated on August 21, 2022