recalculate command

Questions about MultiCharts and user contributed studies.
SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

recalculate command

Postby SP » 18 Nov 2008

Hi Marina,

i read in one of your customers case studies (http://www.tssupport.com/casestudy/case ... bowles.pdf) on problem 7:
"Also what is really important is MC
has a recalculate command built in to its programming language
that can be triggered by a global variable signal from the database
program telling the study to recalculate from bar one again with the
new parameters."

I have a code that i need to turn the status on and off 2 times a day manualy at format studies. Can this be done instead by the global variable bowles describes? If yes, is this GV build in in Multicharts already?

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

recalculate versus on/off.

Postby bowlesj3 » 18 Nov 2008

Exactly what format change do you need to make to the study?

If you study the EL commands help in the TS-Support Web site that gives you the answer actually. Anything that can be changed via EL code can be effected by the recaluculate since that command tells the study to go back and simply redo everything from bar one forward to the current bar.
Below is how I normally use that command.

John.

Code: Select all


if CurrentBar = 1 then
Begin

Here you define the global variables
GV_SetNamedString and GV_GetNamedString

MySym = leftstr(getsymbolname,2);
Value1 = GV_SetNamedString("Calc_Paint_--" + MySym,"N");

end;

Note: Any EL code from bar #1 to the last bar will be redone.


if LastBarOnChart_s then
begin
if GV_GetNamedString("Calc_Paint_--" + MySym,"N") = "R" then
begin
recalculate();
end;
end;
So your study is set to execute on every tick and when the next tick comes in it will detect the value "R" and trigger the recalculate. At the start of the study you have to reset the value from "R" back to "N" so you do not get an infinite loop. The GV is set to "R" by another study in MC or by another program that can change global variables.

However, on the other hand, I have one study that does nothing but put out 6 vertical trend lines with no left right extension (of 6 different colors) in the morning that I clone to use to mark my trade calls. Every hour it does a recalculate to redo the placement of those lines and bump them up an hour so I do not have to go back to far to get them (and so they are always the same, length, color and waiting for me automatically). So that study does not use a GV to trigger the recalculate. Instead it tests a future time variable I set to see if the current time has passed that time. At bar 1 that future time will be recalculated another hour ahead of the current time to restart the hourly recaluclate cycle.

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Postby SP » 20 Nov 2008

Hi John,

thanks for you help. recalculate does exactly what i need for some statistical analysis of two open range timeframes and calculations.

I didnt find recalculate in the dictionary/TS help under Keyword Alphabetical Index.

Thanks again

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Postby bowlesj3 » 20 Nov 2008

Hi SP.
you're right. I checked the help and it is not there. I found it in the list of unsupported reserve words, tried it and as you know it worked. I attached a copy of those reserve words in a better formatted word document. However I am not sure if it is 100% up to date. You have to do a search of the MultiCharts forum for "reserve" or "reserve words" (whatever). You should find two or three of them I think. Actually I attached a second one. I never checked to see if they are different.

There are a lot of other useful commands in the reserve word list. I have used a lot of them and they all worked for me. Actually I think some of the unsupported reserve words are now in the help.

Also, if you need the Global Variables or El Extensions, here is the link.

http://forum.tssupport.com/viewtopic.php?=&p=8189. I use the Map command to bring in some text files which are written out by my database program. Of course the database program can read in EL print statements allowing text files to be passed both ways. I think the map command can write out text files too.

John.
Attachments
MultiCharts Reserve Words_20070801_First.doc
(36 KiB) Downloaded 274 times
MultiCharts Reserve Words_20080214_SecondOne.doc
(32.5 KiB) Downloaded 355 times

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Is anyone using the recalculate command?

Postby bowlesj3 » 03 May 2009

I created a new post for this but decided to keep the same question in here since some new users may be curious about this command and bringing it forward would not hurt.
===================

Is anyone else using the recalculate command and if so, how it is working for you (is it a suspected cause of any aborts of MC either directly or indirectly) and what version of MC are you using?

Thanks,
John.

User avatar
RobotMan
Posts: 375
Joined: 12 Jul 2006
Location: Los Altos, California, USA
Has thanked: 31 times
Been thanked: 13 times
Contact:

Postby RobotMan » 04 May 2009

Thanks John!

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Postby bowlesj3 » 04 May 2009

You are welcome Bob.
John

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Postby bowlesj3 » 05 May 2009

Are you considering using this command Bob?

User avatar
RobotMan
Posts: 375
Joined: 12 Jul 2006
Location: Los Altos, California, USA
Has thanked: 31 times
Been thanked: 13 times
Contact:

Postby RobotMan » 05 May 2009

John bowles said:
Are you considering using this command Bob?
Hi John,
I did not know about it, but it looks like one of those solutions looking for a problem. I will have to play with it and think of one!

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Postby bowlesj3 » 06 May 2009

Hi Bob,

It is very valuable for a discresionary trader who can write in a database language that can submit GVs. Here are the two most useful as I see it.

1/ The bollinger bands are suppose to be adjusted. In day trading you need to do this very fast. MC is a total dog in this regard. In fact for this prupose it is a dead turtle that is so long dead it has evaportated into full none existence. But a database program can be set up such that a single button click can trigger a direct band adjustment via the GV and the recalculate command within about 1 second (as soon as the study is executed on the next tick and the ES is at least this fast most times). That is it, done. You can not really do this automatically (full auto trading) because as far as I am concerned the waves are too complex to trust the programs ability to adjust the bands properly.

2/ You can apply the same technique to adjust your swing size for swings. Again the GV and recalculate command are used with the single button click.

The recalculate has a lot of uses. I figure I could come up with some for full auto trading if I believed in that but I don't.

So the way I see it, for the recalculate to become popular requires a heck of a lot of database programmers to become serious traders. It will probably not happen. It seems no other programs other than MC have this command which can be tripped via GVs so I guess I am a die hard MC user for life.

John.
Last edited by bowlesj3 on 06 May 2009, edited 5 times in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 06 May 2009

can't you make the BB adjust dynamically?

e.g.

if condition1 then
stddev = 2
else
stddev = 3;

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Postby bowlesj3 » 06 May 2009

Not really. It takes a few tries to get it to snuggle properly against a turn in the market so you can use it for the next bounce point (or a reference point for stall or acceleration for that matter). So it needs to be a loop that does a series of adjustments. I figure it is just easier to do a few button clicks manually. Often after a few of those I decide that it is not accurate enough and I start looking for the cause of the turn in the market in the RSI instead. To do this with a program I consider to be far to complex to be borthered with when doing it manually is so much more efficient. Being a long time programmer it is just a matter of deciding when programming has reached the limit of its usefulness (kind of like not overdoing a good thing).

It goes beyond this actually. The eye can decide before hand if the bands are set up close enough to the turns in the market to make it even worth trying to do those adjustments. Program code to do this would be incredibly complex so the path of least resistance (least work) is my preference.

As I am sure everyone knows trading is all about finding the trend lines (multiple levels of them in both directions). What took me a long time to discover is they are not just straigth lines but rather RSI lines, band lines and on rare occassions yes the straight line. This search is very fast with the human eye. The computer helps you after they have been found. I use the computer to help me find them systematically at times (the database does this).
Last edited by bowlesj3 on 06 May 2009, edited 6 times in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 06 May 2009

you have a very sophisticated system.

good for you.

;-)

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Postby bowlesj3 » 06 May 2009

It is not the system that is complex so much as the market is complex and it has to be to try and deal with it. The system is a reciprocal drill down wave system. As an example, the trend line break that just occured in the top of the ES could be found in the 10 second bar RSI. The break was about the 45 line and the bounce was in the 60 line. Both of the wave levels above it were implying that this was a good trade (not just a scalp).

The system works well but the problem with the system is you have to be very awake to run it. Almost all bad trade calls (or missed trades) are my error rather than the systems. You also have to use the computer as much as you can. You can't run it without a program like MC. Qcharts is not good enough. MC alone is not good enough either. You need a database assist with it.
Last edited by bowlesj3 on 07 May 2009, edited 2 times in total.

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Postby bowlesj3 » 06 May 2009

I corrected the wording in the last three posts to be more appropriate (rereading helps).

Bit by bit I am automating more parts of the system to reduce the workload but mostly to reduce missed trades due to human error. Again I don't think it could ever be 100% automated.

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Postby bowlesj3 » 08 May 2009


you have a very sophisticated system.
Actually about 7 of them, each for specific market situations. I select the one I want in the database program before each trade except one which occurs too fast so I have that one memorized. There is a drill down section for trying to get the trade should it stall before my original entry selection. I will be surprised if anyone can program MC fully automated to actually do this type of broader market analysis and drill down before each trade. I sure can't.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 08 May 2009

MC is powerful enough to do a lot of tricks...
when combined with GV/ADE... you are only limited by your imagination.

(I just wish GV/ADE is built-in)

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Postby bowlesj3 » 08 May 2009

Totally agree TJ. 100%.

I have come up with an idea where each of my checklist criteria has a memo field to capture ideas on how I can have MC get the answer to the checklist criteria via GV transfers. Maybe in this way I can eventually bring any system to full automation (programming stubs). I wish TWS has the GVs too. I asked them if I could get the interface specs so I could program direct to it but they kind of got nervous.


Return to “MultiCharts”