SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sun May 20, 2018 1:12 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Mon Mar 31, 2008 6:44 pm 
Offline

Joined: Thu Jan 31, 2008 11:39 am
Posts: 166
And the Equity Curve:


Attachments:
hm3.JPG
hm3.JPG [ 118.05 KiB | Viewed 4620 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 01, 2008 1:58 am 
Offline

Joined: Sun May 20, 2007 9:09 am
Posts: 351
my program does not reset to 1 when the previous trade is loss. not sure where is the problem you encountered.

If you are testing it in realtime paper trading with broker, there may be maximum size you can trade.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 01, 2008 10:43 am 
Offline

Joined: Thu Jan 31, 2008 11:39 am
Posts: 166
strange. I did it in simulation mode. I will check it again.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 01, 2008 11:55 am 
Offline

Joined: Thu Jan 31, 2008 11:39 am
Posts: 166
I could not exactly find out what the error was, but it had something to do with the calculation of the PnL. The PnL was calculated as 0 but the real PnL were -1068 USD. Maybe the High of the Bar is used for the Pnl Calculation? Because the High of the respective Bar is exactly the same as the Buy Price, and so the Pnl is 0.

Maybe this is something I have to set up in the Simulation Execution Provider? Fill Data or Fill Mode changes? They are now set to default values.

I tried some sort of workaround and put the whole

Code:
   if (HasPosition)
      {
         PortfolioValue0 = Portfolio.GetValue();
         Value =  Position.GetValue();
         PnL = Position.GetPnL();
         //Console.WriteLine("Pnl has new value:" + PnL + "; barhigh: " + barhigh);
         NetPnL = Position.GetNetPnL();
         Debt = Position.GetDebtValue();
         CashFlow = Position.GetCashFlow();
         NetCashFlow = Position.GetNetCashFlow();
         //         Console.WriteLine("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}",   Instrument, n, Value,  PnL, NetPnL, Debt, CashFlow, NetCashFlow, PortfolioValue0);         
      }


code into the OnTrade event, and then it works.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 17, 2008 9:19 pm 
Offline

Joined: Wed Feb 27, 2008 7:37 am
Posts: 28
TickJob:
Very gracious of you to share this with us. Especially for newbies like me... Quick question though... Can you please explain the setup - What tickers and time frame to use.... Does one have to pull historical data first? Ah, and can this be applied to any other asset class (like equities/futures) etc?

Thanx in advance..


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 19, 2008 2:54 am 
Offline

Joined: Sun May 20, 2007 9:09 am
Posts: 351
just read all my posts and follow them exactly to do your first test, after that you will be able to find out the questions you want yourself.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 20, 2008 5:23 pm 
Offline

Joined: Wed Feb 27, 2008 7:37 am
Posts: 28
TickJob:
Yes, I did read all your related posts prior to asking the question.
I am a beginner so a copy paste into the code and adding EUR USD as the ticker with 1 min data, I get the following error. I cannot understand that error and thus asked the question.

To all who have tried this and are willing to help:

Can anyone explain what is it that I am doing wrong here. Obviously if TickJob and others are able to post results, the strategy works (or at the least runs) on their setup.

I have 1 min EUR USD data from Nov 2007 to April 18th and copy and pasted this code in the Strategy Code section. It compiles fine, but throws this run time error.

The error screen shots are attached in the file attached in the file.

Any help would be very appreciated. I learn by doing things and perhaps a walk thru of how this strategy is run, will give me a jump on using this software.


Attachments:
Error Codes.JPG
Error Codes.JPG [ 97.14 KiB | Viewed 4554 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 25, 2008 6:23 am 
Offline

Joined: Sun May 20, 2007 9:09 am
Posts: 351
This is one of first program. I first tried with IB demo account in real time mode, so not sure whether simulation mode work or not. you may want to try it in real time mode.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 7:52 pm 
Offline

Joined: Thu Jun 08, 2006 3:56 pm
Posts: 537
Location: BC Canada
Thanks TickJob, what an interesting thread! I haven't read all the threads here, but I imagine that there are very few people who have posted a thread that includes a strategy, bar charts, and performance graphs with such impressive performance.

And it's interesting to see a strategy with a Fibonacci increase in the lot sizes (like "doubling up" only "Fibbing up") to compensate for some losses. Reminds me of various gambling strategies in Roulette, where the lot sizes are controlled to compensate for losses, and to use the house's money if you get ahead. Such strategies all have a "forcing function" that forces cash into the game according to various criteria (Martingale, Reverse Martingale, Fibonacci, etc.)

My compliments. This would be a richer website if we had charts and postings and results for at least the strategines in the docs. I remember looking at WealthLab Pro some years ago, and they had a whole community of strategy posters and competitions, and easy to access rankings ("strategy wars"). There was lots to learn from that pool of knowledge, since all the code was posted too. (Maybe some people even made money.... :-)

Thanks again for the very interesting post. I'll have to look at it more closely one day when I want to try forex trading.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 30, 2008 9:11 pm 
Offline

Joined: Thu Jun 08, 2006 3:56 pm
Posts: 537
Location: BC Canada
I've been reading the code for this strategy, trying to understand it. Most of it I understand, but I am missing some fundamental understanding of how FX is traded.

Could someone please explain why these concepts are important in FX, and what these code bits are doing? Some of these words are variables from the code above, used by the strategy to model the concepts that I'm missing, I think.

Code:
ticksize, lotsize=15000 in screenshot, decimals, range
delta = 2 * range;
LowPrice = Math.Round (LowPrice/ticksize)   *  ticksize;
rangedecimals - 06 - pulled out of "1,06,15000" string in screenshot
qtydecimals - 15000 - pulled out of the string above


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group