EasyLanguage one trade a day - futures io
futures io futures trading



EasyLanguage one trade a day


Discussion in MultiCharts

Updated by ABCTG
      Top Posters
    1. looks_one ABCTG with 6 posts (2 thanks)
    2. looks_two nimrodc with 6 posts (0 thanks)
    3. looks_3 kevinkdog with 1 posts (1 thanks)
    4. looks_4 SMCJB with 1 posts (1 thanks)
    1. trending_up 1,510 views
    2. thumb_up 4 thanks given
    3. group 3 followers
    1. forum 13 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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
 

EasyLanguage one trade a day

(login for full post details)
  #1 (permalink)
israel
 
 
Posts: 7 since Jan 2018
Thanks: 3 given, 0 received

Hi

i am using the following code to get only one trade a day but the simulation show few trades a day
what am i doing wrong ?

thanks

variables:
tradesCounter(0);

[IntraBarOrderGeneration = TRUE]
If Date <> Date[1] then begin
tradesCounter = 0;
end;

If (marketposition (0) = 0) and (tradesCounter < 1)then begin
Buy ("BUY-LONG") next bar at market;
end;
If marketposition (0) <> 0 then begin
Sell ("STOPLOSS") next bar at EntryPrice - 0.5;
end;
If ( Marketposition(0) <> 0 ) and (Marketposition(1) <> Marketposition(0) ) then tradesCounter = tradesCounter+ 1;
Setexitonclose;

Reply With Quote

Can you help answer these questions
from other members on futures io?
where to trade e-mini currency futures
Emini and Emicro Index
Scan by comparing SMAs within 5 mins
ThinkOrSwim
Cumulative Bid/Ask Chart resets after 2Billion
MultiCharts
Buying at the bid, and/or selling at the ask, chasing market
NinjaTrader
TOS to NT8... Need help converting a simple indicator
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Is anyone actually making money?
190 thanks
Micro account vs Funded account (combine)
53 thanks
Are sharks watching on the other side?
32 thanks
Market profile entries/exits
25 thanks
Spoo-nalysis ES e-mini futures S&P 500
24 thanks
 
(login for full post details)
  #2 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,187 since Apr 2013
Thanks: 384 given, 1,423 received

nimrodc,

welcome to futures.io. I would suggest to use the Print reserved to check the value that tradesCounter has throughout your code. This will help you in tracking the problem down.
I would also suggest checking (again the print reserved word can be helpful) when your conditional statement "If ( Marketposition(0) <> 0 ) and (Marketposition(1) <> Marketposition(0) )" is true.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
 
(login for full post details)
  #3 (permalink)
Legendary Market Wizard
Houston, TX
 
Experience: Advanced
Platform: XTrader and Cloud TT
Broker: Advantage Futures
Trading: Energy
 
Posts: 3,490 since Dec 2013
Thanks: 2,782 given, 6,563 received


Or, put the counter inside the loop that gets you into the first trade.

 
Code
variables: tradesCounter(0);

[IntraBarOrderGeneration = TRUE]

If Date <> Date[1] then tradesCounter = 0;

If (marketposition = 0 and tradesCounter = 0) then begin 
    Buy ("BUY-LONG") next bar at market;
    tradesCounter = 1
end;

If marketposition = 1 then Sell ("STOPLOSS") next bar at EntryPrice - 0.5 Stop;

Reply With Quote
The following user says Thank You to SMCJB for this post:
 
(login for full post details)
  #4 (permalink)
Cleveland Ohio/United States
 
Experience: Advanced
Platform: Tradestation
Broker: Tradestation, DeCarley, others
Trading: futures
 
Posts: 2,776 since Jul 2012
Thanks: 1,425 given, 5,344 received

Or use EntriesToday reserved word.

Follow me on Twitter Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
(login for full post details)
  #5 (permalink)
israel
 
 
Posts: 7 since Jan 2018
Thanks: 3 given, 0 received

thanks all for the replies
i tried this option but still get multiple entries per day in the simulation

does any one have similar code that is tested/works for him

thanks

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,187 since Apr 2013
Thanks: 384 given, 1,423 received

nimrodc,

the code @SMCJB posted should not take more than one trade per date.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
 
(login for full post details)
  #7 (permalink)
israel
 
 
Posts: 7 since Jan 2018
Thanks: 3 given, 0 received


ABCTG View Post
nimrodc,

the code @SMCJB posted should not take more than one trade per date.

Regards,

ABCTG

thanks
i tried it but it didnt work for me...
when debugging the code i saw that

If Date <> Date[1] then tradesCounter = 0;

tradesCounter is set back to 0 although the date didnt change
meaning a new date => tradesCounter is set to 0 then the Buy kicks in but then on next round although we still on same date tradesCounter is set to 0 again

anyone understands why ?

Reply With Quote
 
(login for full post details)
  #8 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,187 since Apr 2013
Thanks: 384 given, 1,423 received

nimrodc,

I am not sure I follow you. The condition "Date <> Date[1]" is only true for two bars that have a different date.

As the code @SMCJB posted is using Intrabar Ordergeneration the tradeCounter variable should be declared as intrabarpersist. Otherwise it won't hold its value between the ticks.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
 
(login for full post details)
  #9 (permalink)
israel
 
 
Posts: 7 since Jan 2018
Thanks: 3 given, 0 received


ABCTG View Post
nimrodc,

I am not sure I follow you. The condition "Date <> Date[1]" is only true for two bars that have a different date.

As the code @SMCJB posted is using Intrabar Ordergeneration the tradeCounter variable should be declared as intrabarpersist. Otherwise it won't hold its value between the ticks.

Regards,

ABCTG


the code for declaration was

variables: tradesCounter(0);

anything i am missing or need to add to this so it will be intrabarpersist ?

Reply With Quote
 
(login for full post details)
  #10 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,187 since Apr 2013
Thanks: 384 given, 1,423 received


nimrodc,

yes, by default the variable will not be intrabarpersist. This has to be added specifically for each variable.
You can read more about it here: https://community.tradestation.com/wiki/display/EasyLanguage/IntrabarPersist

Regards,

ABCTG


nimrodc View Post
the code for declaration was

variables: tradesCounter(0);

anything i am missing or need to add to this so it will be intrabarpersist ?


Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:


futures io Trading Community Platforms and Indicators MultiCharts > EasyLanguage one trade a day


January 23, 2018


Upcoming Webinars and Events
 

Every journal equals ten meals for the hungry

Now
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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