♥ 0 |
Can you put in def statements in it, Conditional Wizard TS Editor? If you can , how do you pose the condition? variable >0 does not do it. But the Main Question is what do you need to do to make your own home-made user defined scripts compatible with Conditional Wizard TS Editor? I did it with SimpleMovingAvg by just directly copying and creating another Study called ASimpleMvgAvg. This user-defined study works great, but my VWAP study. I call it AVWAP. It is exactly the same as the TOS proprietary VWAP but I just cut out about half the lines. It works fine in the Regular TOS Editor. Of course, doing what I did for SimpleMvgAvg by copying it outright did not work, so perhaps a function that Condition Wizard TS Editor does not like. It goes like this def isPeriodRolled = compoundValue(1, getyyyYMMDD() != GetYYYYMMDD()[1], yes); def volumeSum; def volumeVwapSum; if (isPeriodRolled) { volumeSum = volume; volumeVwapSum = volume * vwap; } else { volumeSum = compoundValue(1, volumeSum[1] + volume, volume); volumeVwapSum = compoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap); } plot VVWAP= volumeVwapSum / volumeSum; VVWAP.setDefaultColor(getColor(4)); VVWAP.setLineWeight(2); RESOLVED
Marked as spam
|
Private answer
Just found that out on my own. CompoundValue() is the culprit. Looking the definition up of CompoundValue(), I can see why. I am going use the slope of VWAP though someway. Maybe as a Long Open secondary condition. && IsAscending(vwap(period=AggregationPeriod.Day),5) ( I checked it works, not as good but helpful). Gee , I wished I read your response before trying it all. But now I understand & believe that there is very little difference between Conditonal Wizard ThinkScript Editor and ThinkScript Editor, just TOS Studies that have Compound Value or are Proprietary like Carter Studies and Piersen Studies. Who knows there might be another function too that the CW TS Editor can not take too. Thanks again.
Marked as spam
|
|||
Private answer
Yes, I have watched the Video. Really did not hear that CompoundValue() was a no-no. I am so use to actual language manual, as in MTL4 or NinjaTrader. Therefore, it is a step by step experimental process to learn ThinkScript and the in’s and out’s of the TOS Platform. I will will watch the “Almost Autotrading ” Video again. Marked as spam
|
Please log in to post questions.
Ok so right there in your first line if code you run into the first problem. CompoundValue() is not supported in condition wizard. You can use the Study Alert to test things without creating conditional orders. Have you watched my video titled: Thinkorswim AutoTrading Almost? https://www.hahn-tech.com/thinkorswim-autotrade-almost/
I have tested and found no way to use VWAP indicator in the Study Alerts or the Conditional Order. So if you want to learn how to write thinkscript code that works in these tools I suggest you do so without the VWAP indicator.