Trades count - futures io
futures io



Trades count


Discussion in EasyLanguage Programming

Updated
    1. trending_up 2,642 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 11 posts
    2. 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)

 
Search this Thread
 

Trades count

(login for full post details)
  #1 (permalink)
soacm
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.

Reply With Quote

Can you help answer these questions
from other members on futures io?
Big Mo Indicator for NT8
NinjaTrader
Multi Time Frame High/Low/Median levels
NinjaTrader
How do I create Strategy with the Second Entry indicator
NinjaTrader
help with take profit several targets
TradeStation
NT8 Order Management Strategy
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Is anyone actually making money?
123 thanks
ApexTraderFunding.com experience and review
11 thanks
Dax market profile (FDAX, TPO)
7 thanks
Want your NinjaTrader indicator created, free?
7 thanks
Artificial Intelligence (AI) and Chat GPT
7 thanks
 
(login for full post details)
  #2 (permalink)
 syswizard 
Philadelphia PA
 
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
 
syswizard's Avatar
 
Posts: 344 since Jan 2019
Thanks: 20 given, 138 received


soacm View Post
ET = Entriestoday(date[0]);

Where did you find out about EntriesToday ? It's not in the MC Wiki, not in the Powerlanguage PDF either.

Reply With Quote
 
(login for full post details)
  #3 (permalink)
soacm
Bucharest, Romania
 
 
Posts: 58 since Mar 2022
Thanks: 36 given, 13 received



syswizard View Post
Where did you find out about EntriesToday ? It's not in the MC Wiki, not in the Powerlanguage PDF either.

TradeStation

Reply With Quote
 
(login for full post details)
  #4 (permalink)
 syswizard 
Philadelphia PA
 
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
 
syswizard's Avatar
 
Posts: 344 since Jan 2019
Thanks: 20 given, 138 received


soacm View Post
TradeStation

Ah....it's not in Multicharts. Sorry, can't help you then.

Reply With Quote
The following user says Thank You to syswizard for this post:
 
(login for full post details)
  #5 (permalink)
soacm
Bucharest, Romania
 
 
Posts: 58 since Mar 2022
Thanks: 36 given, 13 received


syswizard View Post
Ah....it's not in Multicharts. Sorry, can't help you then.

Any solution is fine as long as it does the same job.

Reply With Quote
 
(login for full post details)
  #6 (permalink)
 syswizard 
Philadelphia PA
 
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
 
syswizard's Avatar
 
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.

Reply With Quote
The following user says Thank You to syswizard for this post:
 
(login for full post details)
  #7 (permalink)
 kevinkdog   is a Vendor
 
 
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;

Follow me on Twitter Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
(login for full post details)
  #8 (permalink)
soacm
Bucharest, Romania
 
 
Posts: 58 since Mar 2022
Thanks: 36 given, 13 received


kevinkdog View Post
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?

Reply With Quote
 
(login for full post details)
  #9 (permalink)
 kevinkdog   is a Vendor
 
 
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.

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #10 (permalink)
soacm
Bucharest, Romania
 
 
Posts: 58 since Mar 2022
Thanks: 36 given, 13 received



kevinkdog View Post
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.

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Trades count


Last Updated on August 21, 2022


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts