Search the web
Sign In
New User? Sign Up
twslink
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Sample Wealth Lab script?   Message List  
Reply | Forward Message #528 of 538 |
Re: Sample Wealth Lab script?

Here is a simple WL script.  How do I program TWSLink to send orders to IB?

*************************

var Bar: integer;
for Bar := 2 to BarCount - 2 do
begin
  if not LastPositionActive then
  begin
    if (priceClose(bar) < priceOpen(bar)) then
      buyAtStop(bar+1, (priceOpen(bar+1) + (priceClose(bar) - priceLow(bar))), 'open+1/2  entry');

    if (priceClose(bar) > priceOpen(bar)) then
      shortAtStop(bar+1, (priceOpen(bar+1) - (priceHigh(bar) - priceClose(bar))), 'open-1/2  entry');
  end 
  else
  begin
    if PositionLong(LastPosition) then
    if (priceClose(bar) > priceOpen(bar)) then
      SellAtStop(bar+1, (priceOpen(bar+1) - (priceHigh(bar) - priceClose(bar))), LastPosition, 'open-1/2 exit');

    if PositionShort(LastPosition) then
    if (priceClose(bar) < priceOpen(bar)) then
      CoverAtStop(bar+1, (priceOpen(bar+1) + (priceClose(bar) - priceLow(bar))), LastPosition,  'open+1/2 exit');
  end;
end;

********************

Thank you.



Sat May 9, 2009 3:46 pm

warrensmith631
Offline Offline
Send Email Send Email

Forward
Message #528 of 538 |
Expand Messages Author Sort by Date

Can someone share a Wealth-Lab script showing how to use TWSLink to send orders from Wealth-Lab to IB? Keep it simple please. I downloaded TWSLink and read...
warrensmith631
Offline Send Email
May 6, 2009
2:22 am

... Hello, well, the wealth-lab sample is kept very simple. i don't know how to provide a smarter introduction as this: INIT REGISTER CONNECT PLACE_ORDER.... ...
maxchinaski
Offline Send Email
May 7, 2009
11:34 pm

Here is a simple WL script. How do I program TWSLink to send orders to IB? ************************* var Bar: integer; for Bar := 2 to BarCount - 2 do begin ...
warrensmith631
Offline Send Email
May 9, 2009
3:46 pm

here is a simple script using TWSLink (from samples dir.) {This sample demonstrates basic Steps to place an Order} var lib: ComVariant; var OpResult:...
maxchinaski
Offline Send Email
May 9, 2009
4:38 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help