Eman93 4,750 posts msg #70911 - Ignore Eman93 | 
1/23/2009 4:16:05 PM
  I am working on some code to run TROs MTC method on Wealth Lab.
 
 Anyone else try auto trading, that would like to share, post here.
 
  | 
Eman93 4,750 posts msg #70912 - Ignore Eman93 | 
1/23/2009 4:16:57 PM
  Eman93
 - Edit message
 modified 1/22/2009 12:00:34 AM
 
 Walid 
 - Ignore Walid 1/17/2009 12:26:37 AM 
 
 Eman, 
 
 C# codeing is what I do for living. Please let me know if I can be of any help. BTW, at 2:00 AM you will suck at almost any thing, get some sleep :-) 
 
 Wealth lab my be your gig, you can totaly automate trades, when it dosent lock up, HO HO. The 5.1 is unstable in live sessions....they are working on a fix. 
 
 This is the code 
 
 /* 
 1. Long only 
 2. If today’s open is below yesterdays close then I buy at a few ticks above the open. 
 3. Profit target $1.00 fixed 
 4. No stop, but liquidate open position(s) on EOD. 
 5. 1 trade per day 
 */ 
 using System; 
 using System.Collections.Generic; 
 using System.Text; 
 using System.Drawing; 
 using WealthLab; 
 using WealthLab.Indicators; 
 
 namespace WealthLab.Strategies 
 { 
 public class MyStrategy : WealthScript 
 { 
 protected override void Execute() 
 { 
 PlotStops(); 
 int dayOfLastTrade = 0; 
 SymbolInfo si = Bars.SymbolInfo; 
 double ticks = 3 * si.Tick; // a few ticks 
 
 // Get the Daily closes 
 SetScaleDaily(); 
 DataSeries dayClose = Close; 
 RestoreScale(); 
 dayClose = Synchronize( dayClose ); 
 
 // Find the start of the second day 
 int stBar = Bars.Count; 
 for(int bar = 0; bar < Bars.Count; bar++) 
 { 
 if( Bars.IsLastBarOfDay( bar ) ) 
 { 
 stBar = bar + 1; 
 break; 
 } 
 } 
 
 // Here's the main loop - start on the second day (so that you know yesterday's close) 
 double todayOpen = Open[stBar]; 
 for(int bar = stBar; bar < Bars.Count; bar++) 
 { 
 if( Bars.IntradayBarNumber( bar ) == 0 ) 
 { 
 todayOpen = Open[bar]; 
 dayOfLastTrade = 0; 
 } 
 
 if (IsLastPositionActive) 
 { 
 Position p = LastPosition; 
 if( Bars.IsLastBarOfDay(bar) ) 
 { 
 if( bar == Bars.Count - 1 ) 
 SellAtMarket(bar + 1, p, "EOD"); // generate an immediate sale/alert if last bar in chart 
 else 
 SellAtClose(bar, p, "EOD"); // for backtesting, just sell at the closing price of this bar 
 } 
 else 
 SellAtLimit(bar + 1, p, p.EntryPrice + 1.00, "Profit Target"); 
 
 
 } 
 else if( todayOpen < dayClose[bar] && dayOfLastTrade != Date[bar].Day ) 
 { 
 if( BuyAtStop(bar + 1, todayOpen + ticks) != null ) 
 dayOfLastTrade = Date[bar].Day; 
 } 
 } 
 } 
 } 
 }  
 
  | 
nojobmaui 19 posts msg #70913 - Ignore nojobmaui | 
1/23/2009 4:18:47 PM
  Aloha Eman
 in regards to your one dollar fill on gap down long plays what scan are you using to find those stocks?
 Thanks
 
  | 
SFMc01 358 posts msg #70914 - Ignore SFMc01 | 
1/23/2009 4:47:14 PM
  Eman93:  Have you been using/trading with this code live a few days?  If so, what results have you experienced?
 
 Thanks ... Steve
 
  | 
Eman93 4,750 posts msg #70915 - Ignore Eman93 | 
1/23/2009 4:59:40 PM
  SFM no live trading. here are some stats.  this is on a gap down day hold for a 1 dollar gain, no stop losses.
 
  
 
  | 
Eman93 4,750 posts msg #70917 - Ignore Eman93 | 
1/23/2009 5:01:49 PM
 
  
 
 This is on a gap down Buy Open +0.20 sell 0.50 profit.
 
 
  | 
Eman93 4,750 posts msg #70918 - Ignore Eman93 | 
1/23/2009 5:03:40 PM
  the stocks used for the back test are under the list COWS, data is 5 min trading 100 shares, only one trade a day at this point.
 
  | 
Eman93 4,750 posts msg #70919 - Ignore Eman93 | 
1/23/2009 5:07:10 PM
  nojobmaui
 - Ignore nojobmaui 1/23/2009 4:18:47 PM
 
 Aloha Eman 
 in regards to your one dollar fill on gap down long plays what scan are you using to find those stocks? 
 Thanks 
 
 
 I am useing the TRO MTC scan.......see the never lose again thread for the method, I am trying to automate it.
 
  | 
Walid 130 posts msg #70926 - Ignore Walid | 
1/24/2009 3:58:28 PM
  Eman,
 
 Yes, please send me the manual. My email address is Engwam@Hotmail.com
 
  | 
nojobmaui 19 posts msg #70928 - Ignore nojobmaui | 
1/24/2009 7:22:50 PM
  Eman93
 - Ignore Eman93 1/23/2009 5:07:10 PM
 
 
 Aloha Eman 
 in regards to your one dollar fill on gap down long plays what scan are you using to find those stocks? 
 Thanks 
 
 
 I am useing the TRO MTC scan.......see the never lose again thread for the method, I am trying to automate it.
 
 Thank you
  
 
  |