Market System Analyzer

Questions about MultiCharts and user contributed studies.
Guest

Market System Analyzer

Postby Guest » 22 Aug 2007

Hi all,

I am slowly learning all the potential of MC.
Recently I came through Market System Analyzer (adaptrade.com).
I am actually trying to export the signal generated in MC to be able to work on it with MSA.
The help file say :
To use the WriteTrades2 function, all you need to do is insert the following line at the end of your system:
Value99 = WriteTrades2 (trade-risk, stop-long, stop-short, “filename”);

Of course I import the writetrades2 function.
And nothing ....
I don't have a clue when the file should be written (is it when I open the workspace or when I chnage the status of the system or when I compile the system while the workspace is open) but it never write any file.

do any of you ever try this function and manage to get the text file writen ?

regards,

Sam.

Ps: by the way, anybody try MSA ? How is it ?

User avatar
ABC
Posts: 628
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 355 times
Contact:

Postby ABC » 22 Aug 2007

Sam,

if I remember correctly the problem was that the TS reserved word "TotalTrades" is not recognized so far by MC (. Therefore the function shouldn't be verified. One workaround for you would be to either block the TotalTrades reserved out or to write your own routine counting the number of trades.

Best regards,

ABC

User avatar
gautama2
Posts: 96
Joined: 10 Jul 2007
Has thanked: 1 time
Been thanked: 1 time

Re: Market System Analyzer

Postby gautama2 » 23 Aug 2007

Ps: by the way, anybody try MSA ? How is it ?


I bought it, but haven't worked much with it.
I'm just setting up a correct pricedatabase and then start testing etc.
But for me it seems to be a very good tool to check out different types of MM which are diffcult (not impossible but not easy also) to code into any program. WealthLab has a few MM-methods built in, but that's not enough and WL doesn't seem to have a good support anymore.

Guest

Postby Guest » 23 Aug 2007

Many thanks for the 2 of you for your answers.

Abc, I have no problem compiling the functions so the problem seem to be diffrent.
here is the writetrade3 function :

Code: Select all

input: TrRisk      (NumericSeries),    { risk for current trade }
        StopL       (NumericSimple),    { initial stop price for long trade }
        StopS       (NumericSimple),    { initial stop price for short trade }
        FName       (StringSimple);     { file name to write results to }
      
 Var:   TradePL   (0),                  { Trade profit/loss }
        NTrades   (0),                  { Number of trades }
        EnDate    (0),                  { Entry date }
        ExDate    (0),                  { Exit date }
        EnTime    (0),                  { Entry time }
        ExTime    (0),                  { Exit time }
        EntPr     (0),                  { Entry price }
        ExPr      (0),                  { Exit price }
        StopPr    (0),                  { Stop price }
        NSize     (0),                  { size of position }
        NTNew     (0),                  { Number of new trades on current bar }
        MarkPos   (0),                  { market position }
        ii        (0),                  { loop counter }
        EnDT      (""),                 { Entry date/time string }
        ExDT      (""),                 { Exit date/time string }
        StrOut    ("");                 { output character string }

 if BarNumber = 1 then
    FileDelete(FName);

 { Collect profit/loss and write out data to file }
 NTNew = TotalTrades - NTrades;
 If NTNew > 0 then Begin
    for ii = 0 to NTNew - 1 Begin
        EnDate = EntryDate(NTNew - ii);
        ExDate = ExitDate(NTNew - ii);
        EnTime = EntryTime(NTNew - ii);
        ExTime = ExitTime(NTNew - ii);
      TradePL = PositionProfit(NTNew - ii);
        EntPr = EntryPrice(NTNew - ii);
        ExPr = ExitPrice(NTNew - ii);
        NSize = MaxContracts(NTNew - ii);
        MarkPos = MarketPosition(NTNew - ii);
        if MarkPos > 0 then
           StopPr = StopL
        else if MarkPos < 0 then
           StopPr = StopS
        else
           StopPr = 0;
        EnDT = DateString3(EnDate, EnTime);
        ExDT = DateString3(ExDate, ExTime);
        StrOut = EnDT + ",  " + NumtoStr(EntPr, 4) + ",  " + ExDT + ",  " + NumtoStr(ExPr, 4) + ",  " +
                 NumtoStr(StopPr, 4) + ",  " + NumtoStr(MarkPos, 0) + ",  " + NumtoStr(TradePL, 2) +
                 ",  " + NumtoStr(TrRisk, 2) + ",  " + NumtoStr(NSize, 0) + Newline;
        FileAppend(FName, StrOut);
        NTrades = NTrades + 1;
   End;
 End;

 WriteTrades3 = NTrades;



and the datestring3 :

Code: Select all

Input:   DateVal   (NumericSimple),
            TimeVal (NumericSimple);

   Var:   TextString   (""),
         YearNum      (0),
            Hour        (0),
            Minutes     (0),
            MinStr      ("");

   If DateVal > 0 and Year(DateVal) >= 0 then Begin
      TextString = NumToStr(Month(DateVal), 0) + "/";
       TextString = TextString + NumToStr(DayofMonth(DateVal), 0) + "/";
      YearNum = Year(DateVal) + 1900;
       TextString = TextString + NumToStr(YearNum, 0);
        Hour = IntPortion(TimeVal/100.);
        Minutes = TimeVal - (100 * Hour);
        if Minutes < 10 then
           MinStr = "0" + NumToStr(Minutes, 0)
        else
           MinStr = NumToStr(Minutes, 0);
        TextString = TextString + " " + NumToStr(Hour, 0) + ":" +
                     MinStr + ":" + "00";
   end
   else
      TextString = "NA";
   
   DateString3 = TextString;


then normaly you just copy Value99 = WriteTrades3 (0, 0, 0, "c:\tradedata.txt"); as the last line of your system and it suppose to export a nice list of trades ready to import in MSA.

but nothing happen with my MC.
if anybody got a clue what is wrong with those piece of code, many thanks for your help.


Sam.

Guest

Postby Guest » 23 Aug 2007

improvement in the situation :

first I create a text file of the same name in c:
then when I recompile the system, the text file is deleted, so clearly the write to text part of the code is working.
So I modify the Totaltrades by the number I found out in the workspace.
And then I got 00000 everywhere in the new text file (but it does create it now).

Reading the piece of code above, you think I have a chance to get it work in MC ?

many thanks.

Sam

User avatar
gautama2
Posts: 96
Joined: 10 Jul 2007
Has thanked: 1 time
Been thanked: 1 time

Postby gautama2 » 23 Aug 2007

Sam,

MC compiles but that doesn't mean that it is supported by MC.

So

NTNew = TotalTrades - NTrades;

might produce no compiling error, but doesn't work anyway.

I got the same effect with SetExitonClose i.e.
Seems you need a workaround for TotalTrades as ABC mentioned.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 23 Aug 2007

Sam,

if I remember correctly the problem was that the TS reserved word "TotalTrades" is not recognized so far by MC (. Therefore the function shouldn't be verified. One workaround for you would be to either block the TotalTrades reserved out or to write your own routine counting the number of trades.

Best regards,

ABC


Just wanted to let you guys know that "TotalTrades" word will be supported in the next version of MC which will soon be released.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 23 Aug 2007

Sam,

if I remember correctly the problem was that the TS reserved word "TotalTrades" is not recognized so far by MC (. Therefore the function shouldn't be verified. One workaround for you would be to either block the TotalTrades reserved out or to write your own routine counting the number of trades.

Best regards,

ABC


Just wanted to let you guys know that "TotalTrades" word will be supported in the next version of MC which will soon be released.


Correction to the previous post: the TotalTrades word will be supported in one of the future versions of MC, however it's NOT going to be the NEXT one.

I apologize for the possible confusion.

User avatar
gautama2
Posts: 96
Joined: 10 Jul 2007
Has thanked: 1 time
Been thanked: 1 time

Postby gautama2 » 23 Aug 2007

Marina,
how about SetExitOnClose and similar, as well as being able to calculate with entry- and exitprices other than OHLC of bars. I.e. prices of triggers within bars?
When does this come?

Regards
Robert

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 23 Aug 2007

Robert,

SetExitOnClose and similar orders will be available in the next beta version of MultiCharts due within the next few days.

As for Intrabar orders generation, it will be introduced in MC 2.2 release due end of 2007.

User avatar
gautama2
Posts: 96
Joined: 10 Jul 2007
Has thanked: 1 time
Been thanked: 1 time

Postby gautama2 » 23 Aug 2007

Great. Thank you.

bomberone1
Posts: 188
Joined: 02 Nov 2010
Has thanked: 14 times
Been thanked: 13 times

Re: Market System Analyzer

Postby bomberone1 » 26 Nov 2010

is it possible connect in realtime MC to MSA that msa calculate the new value at evry new trade?

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 487 times

Re: Market System Analyzer

Postby Dave Masalov » 26 Nov 2010

Dear bomberone1,

What are you referring to as MSA?

bomberone1
Posts: 188
Joined: 02 Nov 2010
Has thanked: 14 times
Been thanked: 13 times

Re: Market System Analyzer

Postby bomberone1 » 26 Nov 2010

Market System Analyzer (adaptrade.com)

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 487 times

Re: Market System Analyzer

Postby Dave Masalov » 08 Dec 2010

Dear bomberone1,

There is no connection between Market System Analyzer and MultiCharts at the moment.


Return to “MultiCharts”