FloatingPL for custom strategy - ThinkOrSwim | futures io social day trading
futures io futures trading


FloatingPL for custom strategy
Updated: Views / Replies:315 / 9
Created: by ext99 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

FloatingPL for custom strategy

  #1 (permalink)
New York
 
 
Posts: 5 since Oct 2019
Thanks: 0 given, 0 received

FloatingPL for custom strategy

Hi everyone,

I am trying to build a simple strategy to backtest: buy if there's been 3 days of consecutive down days ... the problem is, the floatingPL only appears to show the very first buy trade, then it completely ignores all the other signals which don't even show on the chart.

This is what I have on ThinkScript, I would really appreciate it if someone can please help me get this working, to show all the signals on the chart + to work with the FloatingPL - I am not a programmer and really appreciate the help!


Quoting 
AddOrder(OrderType.BUY_AUTO, open is less than close from 1 bars ago and close from 1 bars ago is less than close from 2 bars ago and close from 2 bars ago is less than close from 3 bars ago, open[-1], 100, Color.YELLOW, Color.YELLOW, "Buy");


Reply With Quote
 
  #2 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 329 since Dec 2018
Thanks: 442 given, 674 received

I don't know how to get TOS to take multiple entries off of the same order. One work around which is kind of cumbersome is to add a separate order that includes "close is less than close 4 days ago", "5 days ago" etc...

If you just want to know results I can run it through tradestation and give you some figures. Just let me know which stocks/symbols you want it tested on as well as start and end dates.

Cheers,
Zimmer

Visit my futures io Trade Journal Reply With Quote
 
  #3 (permalink)
New York
 
 
Posts: 5 since Oct 2019
Thanks: 0 given, 0 received



mtzimmer1 View Post
I don't know how to get TOS to take multiple entries off of the same order. One work around which is kind of cumbersome is to add a separate order that includes "close is less than close 4 days ago", "5 days ago" etc...

If you just want to know results I can run it through tradestation and give you some figures. Just let me know which stocks/symbols you want it tested on as well as start and end dates.

Cheers,
Zimmer

Thanks for your reply.

I built an indicator that successfully shows the occurrences on the 1 year daily chart (3 days consecutive down)... maybe as a workaround, we can code the strategy to Buy whenever the custom study is true? I'm not sure how I'd be able to do that, though.

Using the indicator alone (without having this work as a Strategy with FloatingPL) would be very cumbersome to go through the chart of each stock (and for different time periods), and manually try to figure out the P/L and the # of times a buy (after 3 consecutive downs) is actually successful

Reply With Quote
 
  #4 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 329 since Dec 2018
Thanks: 442 given, 674 received

I think you can do

"condition1 = ...."

in thinkscript. Then "buy if condition1" etc

//Revision
On second thought, I don't think that will work. You need separate lines or code for each order. Each buy command can only open 1 order as far as I am aware.


Last edited by mtzimmer1; October 27th, 2019 at 08:02 PM. Reason: Revision
Visit my futures io Trade Journal Reply With Quote
 
  #5 (permalink)
New York
 
 
Posts: 5 since Oct 2019
Thanks: 0 given, 0 received


mtzimmer1 View Post
I think you can do

"condition1 = ...."

in thinkscript. Then "buy if condition1" etc

//Revision
On second thought, I don't think that will work. You need separate lines or code for each order. Each buy command can only open 1 order as far as I am aware.

But then, how is that if you look at MACD Strategy, there are so many buy/sell orders displayed on the chart with the working FloatingPL, while if you look at the code, you'll see there's only one buy and one sell order

Reply With Quote
 
  #6 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 329 since Dec 2018
Thanks: 442 given, 674 received

Oh I understand your question now.

Do you have a sell condition? Thinkscript needs a sell condition to exit the position before opening a new long position. It may be easier if you post the whole code.

Visit my futures io Trade Journal Reply With Quote
 
  #7 (permalink)
New York
 
 
Posts: 5 since Oct 2019
Thanks: 0 given, 0 received


mtzimmer1 View Post
Oh I understand your question now.

Do you have a sell condition? Thinkscript needs a sell condition to exit the position before opening a new long position. It may be easier if you post the whole code.

I don't have a sell, no... I guess if anything I would want to exit at the close of the bar following the buy bar... This is the code:
-----------------

Def x = open is less than close from 1 bars ago and close from 1 bars ago is less than close from 2 bars ago and close from 2 bars ago is less than close from 3 bars ago;

AddOrder(OrderType.BUY_TO_OPEN, x is true, open[-1], 100, Color.YELLOW, Color.YELLOW, "Buy");

AddOrder(OrderType.SELL_TO_CLOSE, x[1], close[-1], 100, Color.YELLOW, Color.RED, "Buy");

-----------------
thanks


Last edited by ext99; October 27th, 2019 at 08:16 PM.
Reply With Quote
 
  #8 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 329 since Dec 2018
Thanks: 442 given, 674 received

What if the fourth day is a down day? Do you still want to exit? Perhaps an exit after the first up day is a good idea.

Visit my futures io Trade Journal Reply With Quote
 
  #9 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 329 since Dec 2018
Thanks: 442 given, 674 received

AddOrder(OrderType.BUY_TO_OPEN, close<close[1] and close[1]<close[2] and close[2]<close[3], close, 100, Color.green, Color.green, "Buy");

AddOrder(OrderType.SELL_TO_CLOSE, close>close[1], close, 100, Color.red, Color.RED, "Sell");

Visit my futures io Trade Journal Reply With Quote
 
  #10 (permalink)
New York
 
 
Posts: 5 since Oct 2019
Thanks: 0 given, 0 received



mtzimmer1 View Post
AddOrder(OrderType.BUY_TO_OPEN, close<close[1] and close[1]<close[2] and close[2]<close[3], close, 100, Color.green, Color.green, "Buy");

AddOrder(OrderType.SELL_TO_CLOSE, close>close[1], close, 100, Color.red, Color.RED, "Sell");

I switched the buy to buy at the open, otherwise the indicator has more of a lag to give a signal...

I'm wondering how to set the sell to close, to simply close 1 day after the buy to open

Reply With Quote

Reply



futures io > > > > FloatingPL for custom strategy

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

Show us your trading desks and win $1,400 in prizes w/Earn2Trade

November
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Day trading the E-mini S&P the Smarter Way w/DaytradingBias

Nov 12
 

Trading for Three Years or Less and You're Still Confused? w/Linda Raschke

Elite Only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Zipline running custom algorithm with custom data blackFury Matlab, R project and Python 1 September 13th, 2018 02:05 PM
Custom database with custom tickers. Is it possible ? enjoyaol AmiBroker 4 March 28th, 2014 01:33 PM
Looking to pay someone to create many Custom Alerts & Custom Scans on ThinkOrSwim jasonbanash ThinkOrSwim Programming 1 January 30th, 2014 07:26 AM
Custom NT indicator has stopped auto-loading with strategy, cache? drwylde NinjaTrader 1 July 9th, 2011 09:11 PM
Custom Strategy with Money Mangement fesx NinjaTrader Programming 1 October 5th, 2009 10:58 AM


All times are GMT -4. The time now is 12:55 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 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