♥ 0 |
Hi, I have watched the video here https://www.youtube.com/watch?v=YW8ruMckbEw I am wondering how “addOrder” function works? I tried the following code but it doesn’t create any order : addOrder(OrderType.BUY_TO_OPEN, true,open[-1],1,Color.RED,Color.RED); Anyone can help ?
Marked as spam
|
Please log in to post questions.
If you are using that line of code and still not seeing a single buy order at the far left of the viewable chart area (the second candle). Then you must have created a study instead of a strategy. The AddOrder() statement is only active in a strategy. The problem is that Thinkorswim does not throw an error when adding this to a study file. It would be better if they fixed that so you could not even save a study with that line in it.
I am sure, I have created a strategy. You can see here https://drive.google.com/file/d/0B9OKiREuczg3VjBfa1FRbWtRODA/view?usp=sharing
Yes, that does appear to be in the Strategies section. I could not see the left side of your chart as it covered by the edit studies window. What is the ticker symbol you are charting and what is the aggregation period?
Thanks for the screenshot. You see the scroll bar at the bottom? You are not viewing the far left of the viewable chart data. Scroll all the way until you get to the very first candle in the chart. There you should see your buy order. On the second candle.
Is it making the real order ? Because I still have a lot of money in my account.
No, it is not making the real order. It is not possible to make a real order using the AddOrder() function in a chart based strategy.