Trading Articles
Article Categories
Article Tools
Trades count
Updated August 21, 2022
trending_up
2,642 views
thumb_up
4 thanks given
group
2 followers
forum
11 posts
attach_file
0 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
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 and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
(login for full post details)
#1 (permalink )
Bucharest, Romania
Posts: 58 since Mar 2022
Thanks: 36 given,
13
received
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 futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#2 (permalink )
Philadelphia PA
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
Posts: 344 since Jan 2019
Thanks: 20 given,
138
received
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.
(login for full post details)
#3 (permalink )
Bucharest, Romania
Posts: 58 since Mar 2022
Thanks: 36 given,
13
received
syswizard
Where did you find out about EntriesToday ? It's not in the MC
Wiki , not in the Powerlanguage PDF either.
TradeStation
(login for full post details)
#4 (permalink )
Philadelphia PA
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
Posts: 344 since Jan 2019
Thanks: 20 given,
138
received
soacm
Ah....it's not in Multicharts . Sorry, can't help you then.
The following user says Thank You to syswizard for this post:
(login for full post details)
#5 (permalink )
Bucharest, Romania
Posts: 58 since Mar 2022
Thanks: 36 given,
13
received
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.
(login for full post details)
#6 (permalink )
Philadelphia PA
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
Posts: 344 since Jan 2019
Thanks: 20 given,
138
received
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.
The following user says Thank You to syswizard for this post:
(login for full post details)
#7 (permalink )
Posts: 3,464 since Jul 2012
Thanks: 1,827 given,
6,985
received
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;
The following user says Thank You to kevinkdog for this post:
(login for full post details)
#8 (permalink )
Bucharest, Romania
Posts: 58 since Mar 2022
Thanks: 36 given,
13
received
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?
(login for full post details)
#9 (permalink )
Posts: 3,464 since Jul 2012
Thanks: 1,827 given,
6,985
received
I would use print statements to debug what I wrote. It could be that close[1] of data2 is not what you think.
(login for full post details)
#10 (permalink )
Bucharest, Romania
Posts: 58 since Mar 2022
Thanks: 36 given,
13
received
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
Ongoing