NexusFi: Find Your Edge


Home Menu

 





strategies on data2?


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one ShadowFox with 4 posts (1 thanks)
    2. looks_two Sinatra Fan with 4 posts (0 thanks)
    3. looks_3 edgefirst with 1 posts (0 thanks)
    4. looks_4 Captain135 with 1 posts (0 thanks)
    1. trending_up 10,390 views
    2. thumb_up 3 thanks given
    3. group 5 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread

strategies on data2?

  #1 (permalink)
 Captain135 
Bay Area, CA
 
Experience: Intermediate
Platform: TradeStation, TOS
Trading: Futures, Equities, Options on Futures
Posts: 48 since Feb 2017
Thanks Given: 53
Thanks Received: 30

In tradestation is there any possible way to enable strategies on data2, data3, data4, etc, or is data1 the only possible chart where strategies can be applied? I have not found this documented anywhere.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

Captain135,

with legacy EasyLanguage strategies you can only trade on Data1 and a strategy is always applied to the main data series of the chart. You can however utilize additional data streams within your strategy code.

Regards,

ABCTG


Captain135 View Post
In tradestation is there any possible way to enable strategies on data2, data3, data4, etc, or is data1 the only possible chart where strategies can be applied? I have not found this documented anywhere.


Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 edgefirst 
Las Cruces, NM
 
Experience: Advanced
Platform: Tradestation, MC, NT
Broker: TradeStation, IB
Trading: Liquid futures contracts
Posts: 56 since Sep 2009
Thanks Given: 389
Thanks Received: 86



Captain135 View Post
In tradestation is there any possible way to enable strategies on data2, data3, data4, etc, or is data1 the only possible chart where strategies can be applied? I have not found this documented anywhere.

As far as I know, you can only place orders on the ticker that is associated with data1. If you want to trade the data2 ticker, you need to create a new chart with that ticker as data1.

Reply With Quote
  #4 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9


edgefirst View Post
As far as I know, you can only place orders on the ticker that is associated with data1. If you want to trade the data2 ticker, you need to create a new chart with that ticker as data1.

Sorry to hijack this thread, but I don't want to start another thread similar to this topic...

So, I heard you say that orders are placed on DATA1, OK, cool. Now let me ask...

If my Data1 is a Flex-Renko chart, can I have a HIDDEN Data2 in the chart that's a 5 minute chart that I can perform end of day tests with within the strat???

Also, I'm assuming that this is applicable to MultiCharts' powerlanguage as well, right?

Thanks for the help.

Reply With Quote
  #5 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157


Sinatra Fan View Post
Sorry to hijack this thread, but I don't want to start another thread similar to this topic...



So, I heard you say that orders are placed on DATA1, OK, cool. Now let me ask...



If my Data1 is a Flex-Renko chart, can I have a HIDDEN Data2 in the chart that's a 5 minute chart that I can perform end of day tests with within the strat???



Also, I'm assuming that this is applicable to MultiCharts' powerlanguage as well, right?



Thanks for the help.

Yes you can add data2 as a 5 minute bar. Your strategy however will only trigger on the end of a bar using data1. The only way to do this is using intrabar order generation and therefore you don't need data2.

I developed a few renko strategies a while back and never found a perfect solution for this. My best idea was to close when the time was greater than about 5-15 minutes before the session close. The last 15 minutes of ES or NQ session doesn't walk much but the hope is you get one bar to close in that period. I would also suggest not taking trades after a certain period before this time.

My suggestion would be don't take a new trade with 45 minutes to go and close any open trade after 15 minutes to go in the session. If you don't get any new bars then set exit on first bar of open.

Last piece of advice is don't use any form of renko in automated trading. It's a trap.

Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9


ShadowFox View Post
Yes you can add data2 as a 5 minute bar. Your strategy however will only trigger on the end of a bar using data1. The only way to do this is using intrabar order generation and therefore you don't need data2.

I developed a few renko strategies a while back and never found a perfect solution for this. My best idea was to close when the time was greater than about 5-15 minutes before the session close. The last 15 minutes of ES or NQ session doesn't walk much but the hope is you get one bar to close in that period. I would also suggest not taking trades after a certain period before this time.

My suggestion would be don't take a new trade with 45 minutes to go and close any open trade after 15 minutes to go in the session. If you don't get any new bars then set exit on first bar of open.

Last piece of advice is don't use any form of renko in automated trading. It's a trap.

thanks for the reply Fox... let me ask you two questions regarding your post:

1) Your strategy however will only trigger on the end of a bar using data1 You're saying that you can not test for Barstatus = 2 on Data2??? and if not, then why not have Data1 be the 5 minute bar, Data2 be the Flex Renko chart, have all the strat tests done on Data2 as I currently test everything on the Renko chart and then use Data1 for the end of day test to close??? Wouldn't that work if what you say is true?

2) Last piece of advice is don't use any form of renko in automated trading. It's a trap. Why do you say that? So far, my trading has matched the backtesting on my renko bars because I've backtested with the entries ending with "this bar on close" and then next bar market for live. It works great, so I ask, why do you think that way? how is it a trap?

Thanks

Reply With Quote
  #7 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157


Sinatra Fan View Post
thanks for the reply Fox... let me ask you two questions regarding your post:

1) Your strategy however will only trigger on the end of a bar using data1 You're saying that you can not test for Barstatus = 2 on Data2??? and if not, then why not have Data1 be the 5 minute bar, Data2 be the Flex Renko chart, have all the strat tests done on Data2 as I currently test everything on the Renko chart and then use Data1 for the end of day test to close??? Wouldn't that work if what you say is true?

2) Last piece of advice is don't use any form of renko in automated trading. It's a trap. Why do you say that? So far, my trading has matched the backtesting on my renko bars because I've backtested with the entries ending with "this bar on close" and then next bar market for live. It works great, so I ask, why do you think that way? how is it a trap?

Thanks

In regards to #1. No, the strategy will only trigger on the close of a bar on data1. So if you want to take trades based on your renko chart bar close, running renko on data2 will not work. To my knowledge, there is no good way to do what you need to do. I would suggest picking a certain amount of time before the close that you would like to try and close. If a bar closes greater than that time you will get closed. Otherwise, setting exit on close will give you a fill at the first new bar of the next session.

In regards to #2. Please read my response here and a few messages up you will find another. Mainly limited data set available and repainting was the biggest disappointment with renko. They are posts #110 and #102

Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9


ShadowFox View Post
In regards to #1. No, the strategy will only trigger on the close of a bar on data1. So if you want to take trades based on your renko chart bar close, running renko on data2 will not work. To my knowledge, there is no good way to do what you need to do. I would suggest picking a certain amount of time before the close that you would like to try and close. If a bar closes greater than that time you will get closed. Otherwise, setting exit on close will give you a fill at the first new bar of the next session.

In regards to #2. Please read my response here and a few messages up you will find another. Mainly limited data set available and repainting was the biggest disappointment with renko. They are posts #110 and #102

OH yes, I understand what you are saying about moving the FR to Data2. What about simply having a second strat that works on an IOG basis to close out at the end of day. The problem I'm having with IOG with my renko chart is that for some strange reason, switching over to IOG causes some of my commands to stop working. And no one can tell me why?

Reply With Quote
  #9 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157

I would suggest the below. Again this is not perfect but it will get a large portion of your closes to automate. Set exit on close will be the failsafe of closing on the first opening bar. I just hacked this together so please test it if you are interested. I would also suggest doing something similar to limit new trades to a certain time before you profittime so you don't open a trade then close it immediately due to these conditions.
 
Code
if marketposition <> 0
and time >= profittime //input designated by you (1545 for 15 minutes to go in ES/NQ central time)
//if trading stocks where a date change is also a session change you don't need the next statements. Just making sure the statement won't close a trade on a new session if the entrytime is greater than the session start
and ((entrytime >= sessionstarttime(1,1) and entrydate = date - 1) //for entries yesterday in the same session
or (entrytime <= sessionendtime(1,1) and entrydate = date)) //for entries today in the same session
Then begin
sell("LPTime") ContractsTraded contract next bar at Market;
buytocover("SPTime") ContractsTraded contract next bar at Market;
end; setexitonclose;

Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 
Sinatra Fan's Avatar
 Sinatra Fan 
Orlando FL
 
Experience: Intermediate
Platform: MultiCharts, Ninja
Trading: Emini ES
Posts: 66 since May 2019
Thanks Given: 7
Thanks Received: 9



ShadowFox View Post
I would suggest the below. Again this is not perfect but it will get a large portion of your closes to automate. Set exit on close will be the failsafe of closing on the first opening bar. I just hacked this together so please test it if you are interested. I would also suggest doing something similar to limit new trades to a certain time before you profittime so you don't open a trade then close it immediately due to these conditions.
 
Code
if marketposition <> 0
and time >= profittime //input designated by you (1545 for 15 minutes to go in ES/NQ central time)
//if trading stocks where a date change is also a session change you don't need the next statements. Just making sure the statement won't close a trade on a new session if the entrytime is greater than the session start
and ((entrytime >= sessionstarttime(1,1) and entrydate = date - 1) //for entries yesterday in the same session
or (entrytime <= sessionendtime(1,1) and entrydate = date)) //for entries today in the same session
Then begin
sell("LPTime") ContractsTraded contract next bar at Market;
buytocover("SPTime") ContractsTraded contract next bar at Market;
end; setexitonclose;

Fox,

This is the first I've heard or seen the reserve word "SetExitOnClose". I just looked it up. According to MC's Keyword Reference, it says...
Closes out the current position at the Close tick of the last bar of the trading session on an intra-day chart; generates the appropriate Market exit order depending on whether the position is long or short.

SetExitOnClose function uses the session closing time specified in the session settings for the symbol in the QuoteManager.
So I'm wondering... if I set the session closing time to be the time I want all open positions to be closed at 4:05 PM EST, according to MC, this function should in fact close out any open positions, right???

Reply With Quote




Last Updated on October 25, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts