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 ?
Market System Analyzer [SOLVED]
- ABC
- Posts: 722
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
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
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
Re: Market System Analyzer
I bought it, but haven't worked much with it.Ps: by the way, anybody try MSA ? How is 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.
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 :
and the datestring3 :
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.
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;
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;
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.
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
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
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
Just wanted to let you guys know that "TotalTrades" word will be supported in the next version of MC which will soon be released.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
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
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.Just wanted to let you guys know that "TotalTrades" word will be supported in the next version of MC which will soon be released.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
I apologize for the possible confusion.
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
-
- Posts: 310
- Joined: 02 Nov 2010
- Has thanked: 26 times
- Been thanked: 23 times
Re: Market System Analyzer [SOLVED]
is it possible connect in realtime MC to MSA that msa calculate the new value at evry new trade?
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
-
- Posts: 310
- Joined: 02 Nov 2010
- Has thanked: 26 times
- Been thanked: 23 times
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Market System Analyzer
Dear bomberone1,
There is no connection between Market System Analyzer and MultiCharts at the moment.
There is no connection between Market System Analyzer and MultiCharts at the moment.