© Copyright 2020 Forex.ca
Please note that foreign exchange and other leveraged trading involves significant risk of loss. It is not suitable for all investors and you should make sure you understand the risks involved, seeking independent advice if necessary.
Just as a question, so does the floating PL reflect what the strategy would make if you ran it through a trade bot?
I'm currently making a strategy that gives good results but I can mirror it's actions with the same results
What language is TOS written in…python, java, #, etc? Btw, based on this initial mistake, it looks like u made $$$…buy/hold?
Thank you for this! In addition to the TOS Learning Center, would you suggest any additional references to use in learning ThinkScript?
anyone could guide me how to build a strategy like this to be able to backtest with a 5min ORB strategy? Tia!
Great I learned a lot , thanks
I wrote a code to auto trade based on STOCHRSI when K above D.. It looks very unprofessional but I made my best and it buys and sells in wrong positions few times
If you would take a look at it and give your opinion, it will be great:
input RSI_length = 14;
input over_bought = 80;
input over_sold = 20;
input RSI_average_type = AverageType.WILDERS;
input RSI_price = close;
input KPeriod = 14;
input DPeriod = 3;
input slowing_period = 1;
input averageType = AverageType.SIMPLE;
input showBreakoutSignals = {default "No", "On FullK", "On FullD", "On FullK & FullD"};
def RSI = RSI(price = RSI_price, length = RSI_length, averageType = RSI_average_type);
def FullK = StochasticFull(over_bought, over_sold, KPeriod, DPeriod, RSI, RSI, RSI, slowing_period, averageType).FullK;
def FullD = StochasticFull(over_bought, over_sold, KPeriod, DPeriod, RSI, RSI, RSI, slowing_period, averageType).FullD;
def OverBought = over_bought;
def OverSold = over_sold;
def line1 = 5;
def line2 = 7.5;
def line3 = 10;
def line4 = 12.5;
def line5 = 15;
def line6 = 17.5;
def line7 = 20;
def line8 = 22.5;
def line9 = 25;
def line10 = 27.5;
def line11 = 30;
def line12 = 32.5;
def line13 = 40;
def line14 = 42.5;
def line15 = 50;
def line16 = 52.5;
def line17 = 55;
def line18 = 57.5;
def line19 = 60;
def line20 = 62.5;
def line21 = 65;
def line22 = 67.5;
def line23 = 70;
def line24 = 72.5;
def line25 = 75;
def line26 = 77.5;
def line27 = 80;
def line28 = 82.5;
def line29 = 85;
def line30 = 87.5;
def line31 = 90;
def line32 = 92.5;
def line33 = 95;
def line34 = 97.5;
def line35 = 100;
def upK = if FullK > line1 and FullD < line1
then 1
else if FullK > line2 and FullD < line2
then 1
else if FullK > line3 and FullD < line3
then 1
else if FullK > line4 and FullD < line4
then 1
else if FullK > line5 and FullD < line5
then 1
else if FullK > line6 and FullD < line6
then 1
else if FullK > line7 and FullD < line7
then 1
else if FullK > line8 and FullD < line8
then 1
else if FullK > line9 and FullD < line9
then 1
else if FullK > line10 and FullD < line10
then 1
else if FullK > line11 and FullD < line11
then 1
else if FullK > line12 and FullD < line12
then 1
else if FullK > line13 and FullD< line13
then 1
else if FullK > line14 and FullD < line14
then 1
else if FullK > line15 and FullD < line15
then 1
else if FullK > line16 and FullD < line16
then 1
else if FullK > line17 and FullD < line17
then 1
else if FullK > line18 and FullD < line18
then 1
else if FullK > line19 and FullD < line19
then 1
else if FullK > line20 and FullD < line20
then 1
else if FullK > line21 and FullD< line21
then 1
else if FullK > line22 and FullD < line22
then 1
else if FullK > line23 and FullD < line23
then 1
else if FullK > line24 and FullD < line24
then 1
else if FullK > line25 and FullD < line25
then 1
else if FullK > line26 and FullD < line26
then 1
else if FullK > line27 and FullD < line27
then 1
else if FullK > line28 and FullD < line28
then 1
else if FullK > line29 and FullD < line29
then 1
else if FullK > line30 and FullD < line30
then 1
else if FullK > line31 and FullD < line31
then 1
else if FullK > line32 and FullD < line32
then 1
else if FullK > line33 and FullD < line33
then 1
else if FullK > line34 and FullD < line34
then 1
else if FullK > line35 and FullD < line35
then 1
else if FullD >= FullK
then -1
else Double.NaN ;
def buy = Upk >= 1;
def sell = Upk < 1;
AddOrder(OrderType.BUY_TO_OPEN, buy, name = "buy");
AddOrder(OrderType.SELL_TO_CLOSE, sell, name = "sell");
Josiah, thank you! My best recent purchase was your “Z distance from VWAP” strategy. How can I see the floatingPL number as a percentage (e.g. for simply charting a hypothetical strategy against the S&P performance for backtesting)? If I cannot, is there a way to thinkScript a customizable PL metric? If so, please know “If you script it, they (and certainly I) will buy!”
Thank you for the video.
Great video Josiah! Do you have one where you explain how to use a Strategy to paper-trade in ToS?
I tried making a script after watching your video. All i wanted to do was have it mark an entry a certain percent up from the daily open price but instead it marks it on every single candle.
Can strategies only be applied to a single charted ticker? Or can they be applied across a broader range (e.g. stocks matching some filter)?
Best ever seen in trading history on you tube.
When I did it my study appeared as red
Very educational Video. Thanks. Can you tell us what minute chat, day chat or hourly chat?
Loved the video… how do you set the "FloatingPL" to show something other than a horizontal line.
How do you use a custom indicator created in ToS in a strategy?
Did backtesting happens on candle close ? Or it can backtest on tick levels
Over all it helped… but you should practice what your going to teach first.
Thank you!
Hey, I could really use some help! How can I just have the chart show me the buy signals without having to specify when to sell?
I want to see all the scenarios of when it would indicate to buy regardless of when I chose to sell. Thanks so much!
Hi there! I found this video extremely useful, for it is one of the only videos out there that really goes in depth to explain the strategy process on thinkorswim. I have a question, however: Is there a way to execute these strategies? To actually buy/sell as the market moves, and take real? P/L
my names on the entries/exits are not showing up…any suggestions?