OEC Indicators Treasure Chest

Discussion in 'Trading Software' started by veggen, Oct 14, 2008.

  1. If someone can code up some EL or C# that will compile clean in EOC and sound an alarm when my four EMAs converge to within an adjustable number of ticks (specified as a parameter without recompiling), I'd be glad to pay for it. PM me and i'll send you the URL to my consulting website so you'll see i'm not a deadbeat.

    I'm an experienced scientifc software developer with no experience in coding up trading systems, so I can handle the all the math and the algorithms if needed. I just don't have the time to learn EL or C# fron scratch and i've always found that two heads are better than one when it comes to software development.

    Since the delta for exactness would be an integer, the code would need to use nint (nearest integer) to convert everything to int ticks. Also would need to take absolute value of the EMA deviations because some would be positive and some negative.

    When the for EMAs converge to within delta, I'd like EOC to play a WAV file to alert me so i can look at the chart and decide on taking the trade.

    If anyone is interested in making this a project for pay and they want to collaborate with developing it, either i could pay you for work-for-hire and retain all rights, or, we could maybe collaborate on developing a copyrighted or patented trading system based on it. Or, if you're good with EOC and willing to give me a freebie skeleton i can fill out later ... it's all good.

    Placement of the initial stop loss is obvious. It might just be a trade-entry system because all it does is signal the entry with no idea how long it would keep going.

    If you're not sure of whether this trade entry signal has any value, just set up a chart setting for a 1-minute graph with 21, 42, 84, 168-min EMAs (preferably the "typical" price, H+L+C/3, but Close would be OK as long as they're EMA). Then run it for 6A, 6C, 6E, 6J and within at most 2-3 days you should see a parabolic move right after the EMAs converge after a consolidation period. A lot of times, two of the currencies will show this pattern within a short period, allowing entry into the second currency immediately on convergence with the confidence given by seeing the other one begin to take off.
     
    #31     Sep 13, 2009
  2. I'm an experienced software developer who uses OEC to do futures trading, but have never programmed real-time systems such as EasyLanguage or C#, and I need some help getting some scripts that will clean compile and be easily modified.

    I am not (yet) a professional mark-to-market trader, so this request for programming assistance is for personal education and is *non-commerical* per *my understanding* of the ET definition. I am not seeking to market any software that anyone can help me develop. I'm posting here because OEC programmers are likely to follow this thread. I have been unable to find any OEC message boards or OEC threads where anyone is willing to do anything even slightly helpful. Even a few EasyLanguage software developers who invite requests for price quotes are either too busy or have not replied to quote requests. So now I'm trying to find someone here.

    There are really three different things that I'd like to have working on the OECTrader platform, but I have so far posted a request for help in getting started with simplest of the three, because, if I could have even just a bare skeleton of working code to alert me that three EMAs have converged, I could continue developing that EMA-convergence alert script to allow testing of either 2, 3, or 4 harmonic EMAs instead of the hard-wired 3, etc.

    That EMA convergence script is the simplest of the three things I'd like to implement, which is described at the bottom of this post and earlier up in the thread. The EMA-convergence signal seemed the least likely of the three that the EOC development team would have any interest in it except maybe as some kind of example of a useful script for their documentation of Custom Indicators to do something more useful than the Hello World script they provide as their only example of code.

    The three things I need to have running with OECTrader, written as Parts 1, 2, and 3 below. After I asked my broker at OEC if he knew of anyone who did OEC programming for pay, he said he did not know of any, but he asked me to write up my needs and he'd pass them on to the OEC development team for their consideration. I'd pay ANYONE who can do ANY of these three things, but up to now I have only mentioned here the simplest one of the three (Part 3 below), because if I could have at least an initial version of Part 3 up and running, I could do Parts 1 and 2 myself later, as time allows. This is my wishlist:

    -----------
    Part 1 (Vervain Crossover--POPULAR):

    A lot of trading systems are based on detecting trend changes signalled by crossovers in moving averages. A highly respected published algorithm for a trading Strategy based on research is Sylvain Vervoort's May 2008 article in Stocks and Commodities titled "The Quest for a Reliable Crossover."

    VervoortCrossover.ELD is a free download written in EasyLanguage available for download if I get access to the TradeStation forums by taking the free trial of TradeStation they are offering now. If I get TradeStation, I can probably also get the TS source code and then try to port that code over to the OEC platform. A *lot* of people are very interested in Vervoort crossover, both for automated trading and for indicators on a graph. Google now shows 5190 hits for http://www.google.com/search?source...rlz=1T4ADBF_enUS322US322&q=vervoort+crossover which I can find other versions of it for many different platforms, but nobody seems to have posted anything about using VervoortCrossover with OEC. I've been trying to find some code for OEC that would clean compile to make a Custom Indicator, not the usual Strategy to implement it, because I'd like to see it in action before converting an Indicator to an automated trading Strategy. So. Here's an implementation of it as an Indicator for thinkorswim at http://www.thinkscripter.com/2009/03/31/vervoort-crossover/ where that post list the TOS script source code and also the nice graph I've attached as taken from that TOS forum post. I tried compiling that code on OEC as if it was EL and it has syntax errors. Also, since that's just one anonymous person's implementation, I'd really rather have the algorithm taken from Vervain's article or an "official" TradeStation implementation. Also, instead of changing colors of the indicator line to indicate crossover, I'd like to be able to put symbols on the graph at the crossover points just like they did in the attached graph for Range Exhaustion of my Part 2 where they used +1 and -1 for buy and sell signals.

    TradeStation members can download a free file named VervoortCrossover.ELD compiled in EasyLanguage code for TradeStation that's probably an accurate implementation. But I believe that file is a *Strategy* that gives Buy/Sell trade signals, while what I'm looking for is an *Custom Indicator* for OEC that I can see on a graph and then use OEC Custom Alerts to play a WAV file and give a popup when those crossovers happen. If the bool variables Buy/Sell are available in a script that compiles in OEC, it would be very easy for me to have Custom Alerts test for them and, eventually, maybe use it as a trading system.

    I've been posting on trader message boards and Googleing to find financial software developers who can give me a VervainCrossover indicator script that compiles with OEC ... but nobody i've found seems interested because none of them work with OEC. I could probably do it myself with a lot of learning curve if i get TradeStation and get VervoortCrossover to work on TS, and then port the script over to OEC, but that would require installing and learning TS but I'd rather just stick with OEC because I have used way too many platforms this year and don't want to learn another one and have it clog up my PC with its DLLs everywhere as most of them have done in the past.
    ------------
    Part 2: (an interesting and unique approach to finding tops and bottoms)

    If I could get Vervain's algorithm running on OEC and have the source code, I could probably adapt the source code given here for an interesting approach to finding near-term tops and bottoms based on oversold or overbought conditions:
    http://newsletter.neoticker.com/200...-trading-with-simple-range-exhaustion-system/
    The graph from that blog post is attached to this post, mostly to show how that author uses +1 and -1 to indicate buy and sell points as an alternative to changing the color of the price line.

    While the Vervoort graph changes the MA from red to green to signal a crossover, an alternative would be to put symbols on the graph at the crossover points. I'd really like to try out the range-exhaustion algorithm on OEC and also have it play a WAV file when those buy and sell points occur. Since this range-exhaustion algorithm is not public domain, you'd almost surely need permission from the author, Lawrence Chan (and maybe Neoticker also) before you could "publish it for commercial purposes."
    -----------
    Part 3: (a very "simple" Custom Indicator to alert for MA convergences Last price in order to signal a possible reversal point)

    I spend a lot of time flipping back and forth between all my charts looking for points where moving averages of different lengths converge to a point. I've previously posted a graph of 6BZ9 on BoE's recent announcement day with MAs of 21, 42, 84, and 168 as their period lengths. I'd like to have OECTrader play a WAV file to alert me when either of two, three, or four (as set by Properties) of the EMAs converge with the last price, but it's a little complicated to put into Custom Alerts because the EMAs won't usually be *exactly* equal. It would be a tremendous help if I could program a Custom Indicator to tell me when the harmonic-length EMAs converge to a point with Last price usually starting a fan-shaped expansion that usually accelerates rapidly. It would be nice if the "exactness" could be made an adjustable parameter under Properties so the script doesn't need to be recompiled to change it. Call that variable SLOP (positive int). If the three moving averages are MA1, MA2, MA3, and LAST is the price, with everything in int ticks, then i'd code up this script to sound a Custom Alarm to alert me to look at the chart and consider taking the trade whenever ALARM becomes true in this pseudocode that's always testing convergence of a hard-wired three harmonic EMAs (a later version will allow the number of harmonic EMAs to be specified under Properties as either 2, 3, or 4). Making the # of EMAs variable makes testing their convergence more complex than adding two and subtracting two to compare the sum against SLOP. To take it even further, I'd eventually like to have the script pop up a prepopulated bracket order for this commodity to either buy or sell, depending on whether LAST is above or below the EMA convergence point. Here is some pseudocode:

    bool ALARM = false
    int SLOP= {inherited from Properties of graph's Custom Indicator, allow values of 0 to 10}
    float LAST = {last price of commodity on this graph, inherited from graph being displayed}
    int BASEPERIOD = {user defined period length of shortest EMA, inherited from Custom Indicator Properties}

    float MA1 = "EMA for BASEPERIOD" {short EMA inherited from graph}
    float MA2 = "EMA for BASEPERIOD*2" {medium EMA inherited from graph}
    float MA3 = "EMA for BASEPERIOD*4" {long EMA inherited from graph}

    if [ABS(INT(MA1 - MA2 + MA3 - LAST)) <= SLOP]
    then ALARM = TRUE
    else ALARM = FALSE
    endif
     
    #32     Sep 13, 2009
  3. Here is easylanguage code for a better volume indicator... if someone could figure out how to define 'upticks' and 'downticks' within the code, I think it could be compiled (the code returns errors for these symbols, and they are not identified as functions that are compatible in the OEC compatibility list. However, the data that trade station uses for these is not supplied in the OEC trader feed (how many contracts are either bought or sold in one bar). I have spent a while trying to figure it out to no avail...
     
    #33     Dec 5, 2009
  4. Also, does anyone have color coded volume indicator?
     
    #34     Dec 6, 2009
  5. I decided It is in my best interest to learn EL myself...

    Coded by me a color-coded volume indicator!
     
    #35     Dec 8, 2009
  6. Pretty easy :)
     
    #36     Dec 8, 2009

  7. Can't open this file unfortunately.

    Could you post (or PM me) the text version pleae?

    Thanks!

    G.
     
    #37     Dec 8, 2009
  8. #39     Dec 9, 2009
  9. retnis

    retnis

    Hello everyone
    I wonder if anyone can help me transfer these indicators tradestation Open and Cray ie to write them in the basic format EL
    Thank you in advance
    Greetings
    BUY SELL PRESSURE
    inputs: len(20),len2(25);
    value1=close-low;
    value2=high-close;
    value3=((value1-value2)/close);
    value4=close of data2-low of data2;
    value5=high of data2-close of data2;
    value6=((value4-value5)/close of data2);
    if value3>0 and value6>0 then begin
    value7=( value3 - value6);
    end;
    Plot1(averagefc(value7,len), "SprdRatio" ) ;
    plot2(averagefc(averagefc(value7,len),len2),"average");
    CUMULATIVE DELTA
    Inputs:
    PitOpen(830),
    PitClose(1500),
    ResetAtPitOpen(False),
    ResetAtPitClose(True),
    PlotZeroLine(True),
    AlertBar(1000),
    AlertColor(Magenta),
    UpColor(Green),
    DownColor(Red);

    Vars:
    BADelta(0),
    UpVolume(0),
    DownVolume(0),
    CumDelta(0),
    MyOpen(0),
    MyClose(0),
    BarColor(0),
    IntrabarpersistMyBarNumber(-1);

    If((Time>=PitOpenAndTime[1]<PitOpenAndResetAtPitOpen)
    Or(Time>=PitCloseAndTime[1]<PitCloseAndResetAtPitClose))then
    Begin
    CumDelta=0;
    End;
    UpVolume=Upticks;
    DownVolume=Downticks;
    BADelta=Upticks-Downticks;

    // Previous bar cumulative delta is current open
    MyOpen=CumDelta;
    // Now add current bar delta to cumulative delta
    CumDelta=CumDelta+BADelta;
    // Current bar close is previous bar cumulative delta + current bar delta
    MyClose=CumDelta;

    If(Absvalue(BADelta)<AlertBar)then
    Begin
    If(MyOpen>MyClose)then
    BarColor=DownColor
    Else
    BarColor=UpColor;
    End
    Else
    BarColor=AlertColor;

    Plot1(MyOpen,"Open",BarColor);
    Plot2(MyClose,"Close",BarColor);
    If(PlotZeroLine)then
    Plot3(0,"Zero");
    MyBarNumber=BarNumber[0];
    MARKET DELTA
    inputs:
    Threshold1(150),
    Threshold2(300),
    Threshold3(600),
    DisplayDelta(false),
    Type(1 {1 = Use Upticks/Downticks, 2 = Use Bid/Ask}),
    BidAskArraySz(1000);
    variables:
    TickSize(MinMove/PriceScale),
    PriceAtIndex(Open),
    BaseIndex(BidAskArraySz/2),
    Red1(RGB(255,185,185)),
    Red2(RGB(255,128,128)),
    Red3(RGB(255,0,0)),
    Red4(RGB(128,0,0)),
    Green1(RGB(210,255,210)),
    Green2(RGB(125,255,125)),
    Green3(RGB(0,255,0)),
    Green4(RGB(0,128,0)),
    i(0);
    variables:
    intrabarpersist Price(0),
    intrabarpersist MyVol(0),
    intrabarpersist VolTmp(0),
    intrabarpersist LastTick(0),
    intrabarpersist MyCurrentBar(0),
    intrabarpersist Index(0),
    intrabarpersist BidAskDelta(0),
    intrabarpersist xDelta(0),
    intrabarpersist TextString(""),
    intrabarpersist MyUpTicks(0),
    intrabarpersist MyDownTicks(0);
    Arrays:
    intrabarpersist Bid[](0),
    intrabarpersist Ask[](0);
    Array_SetMaxIndex( Bid,BidAskArraySz);
    Array_SetMaxIndex( Ask,BidAskArraySz);
    if(Type=1orType=2)andLastBarOnChartandBarType<2then
    begin
    MyVol =Ticks;
    PriceAtIndex=Open;
    ifCurrentBar> MyCurrentBar then
    begin
    VolTmp =0;
    MyCurrentBar =CurrentBar;
    MyUpTicks =0;
    MyDownTicks =0;
    fori=0toBidAskArraySz-1
    begin
    Bid=0;
    Ask=0;
    end;
    end;
    Index =BaseIndex+(Close-PriceAtIndex)/TickSize;
    ifInsideBid<InsideAskthen
    begin
    ifType=1then
    begin
    // Use Upticks/Downticks
    ifDownTicks<> MyDownTicks then
    Bid[Index]= Bid[Index]+ MyVol - VolTmp
    elseifUpTicks<> MyUpTicks then
    Ask[Index]= Ask[Index]+ MyVol - VolTmp
    else
    begin
    ifClose<= LastTick then
    Bid[Index]= Bid[Index]+ MyVol - VolTmp
    else
    Ask[Index]= Ask[Index]+ MyVol - VolTmp;
    end;
    end
    else
    begin
    // Use Bid/Ask
    // Warning: TradeStation provides snapshot of bid/ask
    ifClose<=InsideBidthen
    Bid[Index]= Bid[Index]+ MyVol - VolTmp
    elseifClose>=InsideAskthen
    Ask[Index]= Ask[Index]+ MyVol - VolTmp
    else
    begin
    // Last tick was between bid/ask
    ifClose<= LastTick then
    Bid[Index]= Bid[Index]+ MyVol - VolTmp
    else
    Ask[Index]= Ask[Index]+ MyVol - VolTmp;
    end;
    end;
    end;
    MyUpTicks =UpTicks;
    MyDownTicks =DownTicks;
    VolTmp = MyVol;
    LastTick =Close;
    xDelta =0;
    Price =Low;
    while Price <=High
    begin
    Index =BaseIndex+(Price -PriceAtIndex)/TickSize;
    TextString =NumToStr(Bid[Index],0)+" x "+NumToStr(Ask[Index],0);
    Value99=Text_New(Date,Time,0," ");
    Text_SetString(Value99, TextString);
    Text_SetLocation(Value99,Date,Time, Price);
    Text_SetStyle(Value99,1,1);
    BidAskDelta = Ask[Index]- Bid[Index];
    if BidAskDelta >Threshold3then
    Text_SetColor(Value99,Green4)
    elseif BidAskDelta >Threshold2then
    Text_SetColor(Value99,Green3)
    elseif BidAskDelta >Threshold1then
    Text_SetColor(Value99,Green2)
    elseif BidAskDelta >=0then
    Text_SetColor(Value99,Green1)
    elseif BidAskDelta <-Threshold3then
    Text_SetColor(Value99,Red4)
    elseif BidAskDelta <-Threshold2then
    Text_SetColor(Value99,Red3)
    elseif BidAskDelta <-Threshold1then
    Text_SetColor(Value99,Red2)
    else
    Text_SetColor(Value99,Red1);
    xDelta = xDelta + BidAskDelta;
    Price = Price +TickSize;
    end;
    ifDisplayDelta=truethen
    begin
    Value99=Text_New(Date,Time,0," ");
    Text_SetString(Value99,NumToStr(xDelta,0));
    Text_SetLocation(Value99,Date,Time,Low-TickSize);
    Text_SetStyle(Value99,1,1);
    if xDelta >=0then
    Text_SetColor(Value99,Green)
    else
    Text_SetColor(Value99,Red);
    end;
    end;
     
    #40     Oct 27, 2015