Announcement

Collapse
No announcement yet.

OddBall

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Alex,

    I was wondering how difficult it would be to add the coding to this to send orders to IB when this triggers the long/short trades? I've taken a look at the EFS code....and I see the Strategy.long, strategy.sell, etc...I'm slowly coming up to speed with the EFS language. Would this be difficult to do? It would need to send a long buy when it crossed long if no position, a sell/short if long, and a cover/long if it was already short...since this is a system that is always in a trade.

    Thanks for any input,

    cas

    Comment


    • #17
      cas,

      Info on IB intergration can be found here.
      Regards,
      Jay F.
      Product Manager
      _____________________________________
      Have a suggestion to improve our products?
      Click Support --> Request a Feature in eSignal 11

      Comment


      • #18
        Well, I started out trying to figure out EFS integration into IB with the Odd-ball as an example. Using Alex's original OddBall, I first attempted to get this to send to the PaperTrade module, so that I could watch how it works for a bit, then with the idea of changing the papertrade code over to the IB code after i've watched it for a bit. Once I see how to do it in the OddBall, i'll be able to do it on other EFS. I like the oddball as an example, because it is always in a position. can anyone help me with what i'm missing, because I'm not getting any results in the papertrade module when I run this in replay. The help is great, as us non-programmers are able to figure out by looking at past examples, and slowly able to get things going for the trading that we do.

        Thanks!

        cas

        my wannabe code:

        var vLastAlert = -1;
        var trade = new PaperTradeBroker

        function preMain() {
        setPriceStudy(true);
        setStudyTitle("OddBall-Signals");
        setColorPriceBars(true);
        setComputeOnClose();
        }

        function main(nInputLength, nSymbol) {
        if (nInputLength == null)
        nInputLength = 7;
        if (nSymbol == null)
        nSymbol = "$ADV";

        var vClose = close(0, 1, nSymbol);
        if (vClose == null)
        return;

        var vClose1 = close(-nInputLength, 1, nSymbol);
        if (vClose1 == null)
        return;

        var OddBall = ((vClose - vClose1) / vClose) * 100;

        if (OddBall>3)
        onAction1()

        else if (OddBall<3)
        onAction2()

        return null;
        }
        function onAction1() {
        setChartBG(Color.lime);
        setPriceBarColor(Color.blue);
        if (vLastAlert !=1) trade.buy(getSymbol(), 1, PaperTradeBroker.Market)
        //if (vLastAlert != 1) Strategy.doLong("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
        if (vLastAlert != 1) drawTextRelative(0, 1, close().toFixed(2), Color.white, Color.blue, Text.BOLD|Text.CENTER|Text.RELATIVETOBOTTOM, "MS Sans Serif", 10, 1);
        if (vLastAlert != 1) Alert.addToList( "ES #F", "Long "+close(), Color.black, Color.blue )
        //if (vLastAlert != 1) Alert.playSound( ding.wav )
        //if (vLastAlert != 1) Alert.email( Long, OddBall )
        vLastAlert = 1;
        }
        function onAction2() {
        setChartBG(Color.red);
        setPriceBarColor(Color.yellow);
        if (vLastAlert !=2) trade.sell(getSymbol(), 1, PaperTradeBroker.Market)
        //if (vLastAlert != 2) Strategy.doShort("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
        if (vLastAlert != 2) drawTextRelative(0, 1, close().toFixed(2), Color.white, Color.red, Text.BOLD|Text.CENTER|Text.RELATIVETOBOTTOM, "MS Sans Serif", 10, 1);
        if (vLastAlert != 2) Alert.addToList( "ES #F", "Short "+close(), Color.black, Color.blue )
        //if (vLastAlert != 2) Alert.playSound( ding.wav )
        //if (vLastAlert != 2) Alert.email( Short, OddBall )
        vLastAlert = 2;
        }

        Comment


        • #19
          Help is on the way...

          Are you using DynaOrder??

          If so, I can help quite easily. I have created many scripts with DynaOrder and can put it together for you rather quickly.

          Brad
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment


          • #20
            Brad,

            Thanks for the reply....I'd consider using DynaOrder...I was just looking at that as a solution, as it would allow me to papertrade as well as send orders to IB. I'd like it to work as the oddball-sig.efs that Alex originally recreated.

            That works well when backtesting in esignal, and is a good/simple example that once I figure out how to get orders to IB, i'll be able to adapt it on other EFS in the future. I just downloaded DynaOrder, so i'll have the 15 day trail. If it is really easy, and you don't mine helping me, I'd really appreciate it!

            Thanks,

            Chris

            p.s., just as a side note...what is the dynaorder advantage as to just doing this from within esignal/EFS? Is it because Dynaorder handles all of the items I would have to code in the EFS otherwise?

            Comment


            • #21
              DynaOrder Benefits..

              They are simple....

              Order tracking and the ability to return certain values that are not available within the esignal IB code.

              Generally, Dynaorder is a little more robust than the esignal stuff. I like to use it because you can do more complex stuff with it.

              I will get into converting this code today and test it tomorrow AM. If there are no bugs, then I will send it to you (on the thread).

              Brad
              Brad Matheny
              eSignal Solution Provider since 2000

              Comment


              • #22
                Brad,

                Great..I really appreciate it! That would let me try it out for a bit before the 15 day trial expires.

                Chris

                Comment


                • #23
                  First Prototype...

                  Here you go...

                  I will have to run this tomorrow and test it for bugs, but this is the basic structure for entering orders.

                  I create the variables necessary to handle the entry/reversal information and I create "Strategy" variables to handle the trading system status. Then, we simply test for these conditions and execute the orders.

                  We can do more with time restrictions, stop levels and profit targets (if you want).

                  So... Here you go - our first attempt at a DO inables ODDBALL.

                  Brad
                  Attached Files
                  Brad Matheny
                  eSignal Solution Provider since 2000

                  Comment


                  • #24
                    Oops....

                    Try this. Ignore the other file as it had a couple of bugs.

                    Brad
                    Attached Files
                    Brad Matheny
                    eSignal Solution Provider since 2000

                    Comment


                    • #25
                      Thanks alot Brad..this is great, i'll check it out today. One Prob i find with the oddball in replay is that esignal doens't seem to replay the $add correctly, so it is hard to replay and have it gove correct signals....so I have to wait for ones from the current market to happen.

                      cas

                      Comment


                      • #26
                        Brad,

                        I just got a chance to look at this really quick today..I didn't seem to be getting any signals..ie; no colored bars, etc as the code looked like it should have been doing. I didn't have alot of time to compare the code with the original oddball-sig from Alex yet. Any ideas? This is great..I can see what is needed to get it to work with DO...almost there. :-)


                        cas

                        Comment


                        • #27
                          Revisions..

                          Here you go...

                          I had to make some changes to the LOGIC of the file you posted to get it to work. Nothing serious, but incorrect logic causes illogical function.

                          I'm going to post two file. The first is teh DO code for Oddball and the other is an Oddball Indicator (created from your original code). I use the OddBall indicator to confirm the actions fo the OddBall DO code.

                          I'm getting results in my DO papertrader - so you should too.

                          Brad
                          Attached Files
                          Brad Matheny
                          eSignal Solution Provider since 2000

                          Comment


                          • #28
                            OddBall Indicator...

                            Here is the indicator..

                            Brad
                            Attached Files
                            Brad Matheny
                            eSignal Solution Provider since 2000

                            Comment


                            • #29
                              THANKS

                              Thank you Brad fro myself too
                              Fabrizio L. Jorio Fili

                              Comment


                              • #30
                                Brad,

                                Awsome...I got it running, and it looks like it is working with DO I'll watch it for a bit, and take a look at the code in the editor over the weekend. This is greatly appreciated!

                                Have a good weekend!

                                cas

                                Comment

                                Working...
                                X