Not logged in
Viewing 5 posts - 1 through 5 (of 5 total)

Forums>StrategyQuant>General Discussion>Java API documentation?

  • #238874|
    Participant
    1 Posts

     

    First of, congrats for your job. Currently I am more a Java/Python-oriented researcher, but I have just discovered SQX because a client of mine needs me to develop his project using SQX and I think it is pretty interesting.

    I am finding unnecessary complex to do it, though, just because I am not finding any API documentation, so even by checking similar predefined blocks to the ones I need to implement, I still can’t be sure of the use of each method, annotation, class…

    Just as a couple of examples, regarding to the annotations or simple methods variables such as “Calls” from IndicatorBlock, I can figure out more or less its function, but do really miss the API documentation to be able to be sure the purpose of these methods, functions, variables…

    So, in order to know how complex/easy is it going to be to implement this client’s project, and beyond that, in order to think in develop in the near future another projects in SQX instead of other platforms, I would like to know whether there is any documentation to this specific module of SQX (the Java API/coding) and I’ve not been able to find it or it comes with no documentation. I have read in other posts that documentation about the API would be available with this last version of SQX, if that is the case, where could I find it?

    Thanks in advance!

    #238895
    Administrator
    2327 Posts

    Hello Albert,

    unfortunately, we are still behind with the programming and API documentation. There is a short PDF guide Extending SQX, that is distributed together with SQ X, it contains howto’s and samples for the most frequent things, like how to add new indicator and metric.

     

    Until we do that, maybe if you’ll contact me directly we can discuss what exactly your goal is and if and hgow it can be made with SQ, and how complicated it would be. I’m sending you a PM with my email.

     

     

    Mark
    StrategyQuant architect

    #240862
    Customer
    11 Posts

    Hi Mark,

    during the meantime I became a little “specialist” in programming of my own SQX-extensions :). But unfortunately all the helpfull content of “https://docs.strategyquant.com/api/*” was deleted by you from the www.

    Also if it should be outdated: Could you please provide a zipped copy of it’s former content to people like me? I’m sure, that the most it (like the complete documentation of “SQTime.*” for example) will be usable till today … .

    Many thanxxx in advance for your help,

    best regards: kleva.

     

     

    #240876
    Administrator
    2327 Posts

    Hello,

    I’m really glad you were able to extend SQ X with the uncomplete documentation.

    Here’s link to newly generated API documentation: https://strategyquant.com/sqxapi/

    note that it includes only the basic classes that you should use in Snippets, not complete classes in all our libraries.

     

    Please let me know if you are missing something.

     

    It would also help me if I can see the kind of extensions you are doing, don’t know if there are some “trade secrets”, don’t you want to share some of your extensions with other users through our Codebase?

     

    If you don’t want to publish it maybe you can send them to me by email – send me a message and I’ll let you know my email address. It would help me understand what you work with and what kind of support you need.

    • This reply was modified 3 months, 3 weeks ago by  Mark Fric.

    Mark
    StrategyQuant architect

    #241110
    Customer
    11 Posts

    Hi Mark,

    sorry for the late response, I was some weeks not here (and forgot to set the “notify”-button)… .

    Many thanks for the link to the new API-documentation: It’s exactly what I was searching for :)!

    Currently I’m still a “SQX-Java-student”. But I’m sure, that I will publish some practicable extension under “Codebase” later, if it’s finished.

    To let you better know what I’m doing, here for example a loop that I’m using in an (martingale-like) MM-extension. It calculates the “orderdayPipsPL” for the day BEFORE the actual day:

    //—

    orderdayPipsPL = 0; //when MM is called, we have to zeroize it before the loop will start

    for(int i=Strategy.Trader.getHistoryOrdersCount()-1; i>=0; i–)
    {
    order = Strategy.Trader.getHistoryOrder(i);

    if(!OrderFunctions.identify(order, Strategy, Symbol, 0, MagicNumber, Comment)) continue;

    if(!order.isFilledOrder()) continue; // ignore pending orders

    if (order.isLong() || order.isShort())
    {
    orderTime = order.CloseTime;
    if (order.isLong())
    {
    order.PipsPL = (float)Strategy.convertRealPriceToPips(Symbol, (order.ClosePrice – order.OpenPrice));
    }
    else if (order.isShort())
    {
    order.PipsPL = (float)Strategy.convertRealPriceToPips(Symbol, (order.OpenPrice – order.ClosePrice));
    }
    //—
    if (orderTime >= todayStart && orderTime <= todayEnd) //we are at the actual day
    {
    //nothing to do
    }
    else
    {
    if (orderdayStart==0 && orderdayEnd==0)
    {
    orderdayStart = SQTime.correctDayStart(orderTime);
    orderdayEnd = SQTime.correctDayEndMT(orderTime);
    orderdayLots = order.Size;
    }
    if (orderTime >= orderdayStart && orderTime <= orderdayEnd) //we are at the order day
    {
    orderdayPipsPL += order.PipsPL;
    }
    else if (orderdayPipsPL!=0) //now we are already before the order day
    {
    if (orderdayPipsPL<0)
    {
    absSL = Strategy.convertRealPriceToPips(Symbol, (order.OpenPrice – order.StopLoss));
    if (absSL<0) absSL = -absSL;

    factor = -FactorSL * orderdayPipsPL / absSL;
    if (factor<0) factor = -factor;
    if (factor<MinLotsFactor) factor = MinLotsFactor;

    tradeSize = orderdayLots * factor;
    break;
    }
    else if (orderdayPipsPL>0)
    {
    // nothing to calculate
    tradeSize = Math.min(LotsIfNoMM, MaxLots);
    break;
    }
    else break;
    }
    }
    }
    }

    //—

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.