PureBytes Links
Trading Reference Links
|
David , Ton,
The way of programming you suggested really results in more structured code.
I elaborated around in that way and it learns me I really have a circular
reference in the code.
What a wanted to do is , using a variable as a "global variable " similar
as in Visual Basic, Delphi/Pascal , recursively accessible from any
subcode in the program .
It seems not to be allowed in MS-language (I wonder why not), so I think a
have to find ways to program around to get the desired results .
Thanks for your contributions,
Gerard
-----Original Message-----
From: David Bozkurtian <dbozkurtian@xxxxxxxxxxx>
To: metastock@xxxxxxxxxxxxx <metastock@xxxxxxxxxxxxx>
Date: 04 January, 2000 5:27 AM
Subject: Re: Referring to the status of the trade in system tester
>Gerard,
>
>Not having done this myself, I can only go by what you are writing. Looks
>like there IS a circular reference. I would try the following.
>Create a single indicator which captures your entries and exits. Have the
>indicator create 3 values.
>
>If("conditions met to open trade",1, if("conditions met to close
>trade",-1,0)
>
>In your open and close tabs, use the value of this indicator to tell you
>what you want. This modularizes the system into a single variable which you
>should be able to plop into any system.
>
>Let me know if this helps.
>
>David
>
>For example:
>
>Trade
>
>From: "Gerard Jeuken" <gjeuken@xxxxxx>
>Reply-To: metastock@xxxxxxxxxxxxx
>To: "metastock-list" <metastock@xxxxxxxxxxxxx>
>Subject: Referring to the status of the trade in system tester
>Date: Tue, 4 Jan 2000 15:09:07 +0100
>
>Writing code in the EnterLong or CloseLong -tabs of a system-test , I
>would like to refer to a variable or costume indicator , indicating
whether
>the trade is "long" "short" or "out" at the actual bar.
>I tried to solve this by writing a costume indicator for the status of the
>trade , for instance for the status of "long" or "out"
>
>{name :"Status_Long" }
>{Remark: True if long , False if out}
>
>If( "open formula", true ,
> if("close formula",false, prev)
> )
>
>"open formula" is the code of the EnterLong-tab and "close formula" is the
>code of the CloseLong-tab of the system tester.
>This indicator works fine , however if I refer to it from the code for
>"Close formula" of the system tester an error is generated telling me I'm
>using a circular reference . Even if I refer to it by ref(Status_Long ,-1)
a
>error is generated .
>
>
>Does anyone have a solution to be able referring to the status of the
>trade?
>Thanks in advance
>
>
>Gerard
>
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>
>If({condition} 'your open formula' = 1 {thus true},
{then do} +1 {TRUE},
{else, thus false, do} 0 {FALSE} {or do another condition}
)
-----------------------------------------------------------------
If({bullish} C > Mov(c,5,s)=1 {thus IS one and positive in your SysTst},
{then do} +1 {=TRUE for SysTst},
{else and false do 0 (eg negative) or do another (nested) condition}
If({bearish} C < Mov(c,5,s)=1 {thus IS one and negative in your SysTst},
{then do} 0 {=FALSE for SysTst},
{else and false, do 0 (eg negative) or do another (nested) condition}
PREV
)
)
--------------------------------------------------------------------
Regards,
Ton Maas
ms-irb@xxxxxxxxxxxxxxxx
Dismiss the ".nospam" bit (including the dot) when replying and
note the new address change. Also for my Homepage
http://home.planet.nl/~anthmaas
|