PDA

View Full Version : Weird return from Result[i] and other issues


cesarx2
17th October 2009, 10:34 AM
Hi David, me again :-)

I am studying the Vitamin-C user guide. I coded the very first stop function (TimeStop). It should give only "1" value bars for entry and exit in MS. But strangely it's returning also "2". Please find the chart image attached. Blue bars are entry, red ones are exit.

Also, I tried to use dprintf insode the loop for debugging this issue, but it did not print anything. I use it this way:

dprintf("Date=%d, ExitTrigger=%d\n",GetDate(i), Result[i]);

OTHER ISSUES

I'd listed some other issues for your backlog:

1) I tried to use scripts from other folder (as stated in the user guide), not contained in Vitamin-C (VC) folder ("C:\MetaStock Scripts\MSVC\Simple.c"), with the full path being explicitly defined in MS indicator call. VC tries to open as "C:\VitaminCScript\C:\MetaStock Scripts\MSVC\Simple.c".

2) The Save functionality is behaving as Save As in the VC editor. It always ask the filename and also a overwrite confirmation.

3) I think it would help some new users if you stated in the user guide that, when copying code to VC editor, some unprintable characters maybe copied causing runtime errors. It did occur to me when copying NewModifiedAverage()

cesarx2
17th October 2009, 10:49 AM
Hi David,

I found what was wrong, I forgot to point to my version of TimeStop.c, so what was being print was the sample version installed with VC (that actually differs entries from exits). Sorry for that!

The other issues still apply.

Thanks!

Cesar

David Samborsky
17th October 2009, 01:41 PM
1) I tried to use scripts from other folder (as stated in the user guide), not contained in Vitamin-C (VC) folder ("C:\MetaStock Scripts\MSVC\Simple.c"), with the full path being explicitly defined in MS indicator call. VC tries to open as "C:\VitaminCScript\C:\MetaStock Scripts\MSVC\Simple.c".

You should always store scripts in the VitaminCScript folder. Everything is referenced to that folder. It just makes it easier for newcomers who have never had any C programming experience as well as limited MSFL coding.

2) The Save functionality is behaving as Save As in the VC editor. It always ask the filename and also a overwrite confirmation.

Yes it does this but I could add an option to disable this in future releases.

3) I think it would help some new users if you stated in the user guide that, when copying code to VC editor, some unprintable characters maybe copied causing runtime errors. It did occur to me when copying NewModifiedAverage()

If you copy from the pdf you may have some problems. I suggest that you install the free borland compiler which is used as syntax checker to check your code before you actually run it from MetaStock. See Appendix D in the User Guide on how to do this.

udanii
26th October 2009, 05:18 AM
I plotted the profit stop indicator form the example in metastock , as a result it s its showing the indicator at a few places and not showing the indicator at many places where it should .

In the attached image , have kept profit threshold at 1 Pc , so all the five entries should have had exits , but the indicator shows exit only in 2 places .

Not sure where have i gone wrong.

Thanks

Gaurav Udani

udanii
26th October 2009, 06:28 AM
I plotted the profit stop indicator form the example in metastock , as a result it s its showing the indicator at a few places and not showing the indicator at many places where it should .

In the attached image , have kept profit threshold at 1 Pc , so all the five entries should have had exits , but the indicator shows exit only in 2 places .

Not sure where have i gone wrong.

Thanks

Gaurav Udani


From what i understand i think it is opening one position and only after the close of that it is taking the next position , can we make it consider all long and short entries ?

udanii
26th October 2009, 06:37 AM
From what i understand i think it is opening one position and only after the close of that it is taking the next position , can we make it consider all long and short entries ?


Figured it out

Thanks