StockFetcher Forums · General Discussion · Auto Trading<< 1 2 3 >>Post Follow-up
Eman93
4,659 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,659 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
296 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,659 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.

Image and video hosting by TinyPic

Eman93
4,659 posts
msg #70917
Ignore Eman93
1/23/2009 5:01:49 PM

Image and video hosting by TinyPic

This is on a gap down Buy Open +0.20 sell 0.50 profit.


Eman93
4,659 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,659 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


StockFetcher Forums · General Discussion · Auto Trading<< 1 2 3 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2016 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus