API Support Forum
User Profile

Viewing User Profile for: MFrasson3344


About

Nov 09, 2015 05:19 PM

Jun 09, 2020 07:07 AM

Jun 09, 2020 07:11 AM



Post Statistics
MFrasson3344 has contributed to 33 posts out of 4814 total posts (0.69%) in 1706 days (0.00 posts per day).

20 most recent posts:

API Support » Trailing Stop and Trailing Stop Limit order - version issue Jun 09, 2020 @ 07:07 AM (Total replies: 2)

There is a bug in the "Versions" collection (GF API) of a Trailing Stop and Trailing Stop Limit order.

I'm using the new GF API, but i found the issue with old OEC api and with "Gain Trader Developer" application (lastest version) too.
I used a Demo account + developer account (I hope the problem is not in the live accounts! please check).

To reproduce the issue:
Place a Trialing Stop order and wait for it to follow the market. The first automatic change to the order is performed correctly, but after this the "Versions" collection always contains the same data that correspond to the second version of the order. This is an example of the order versions collection:

{Sell 1 ESM20 3194.00 Trailing Stop, Ref Price: 3197.5, Delta: 0} (Order creation version)
{Sell 1 ESM20 3194.25 Trailing Stop, Ref Price: 3197.5, Delta: 0} (first auto modification) --> OK
{Sell 1 ESM20 3194.25 Trailing Stop, Ref Price: 3197.5, Delta: 0} (second auto modification) --> NOT OK!! Same as the first modification
{Sell 1 ESM20 3194.25 Trailing Stop, Ref Price: 3197.5, Delta: 0} NOT OK! Same as the first modification
{Sell 1 ESM20 3194.25 Trailing Stop, Ref Price: 3197.5, Delta: 0} NOT OK! Same as the first modification
{Sell 1 ESM20 3194.25 Trailing Stop, Ref Price: 3197.5, Delta: 0} NOT OK! Same as the first modification
{Sell 1 ESM20 3194.25 Trailing Stop, Ref Price: 3197.5, Delta: 0} NOT OK! Same as the first modification

We are near to release a new version of our application with new GF API and i would like to understand if this is an API issue or a server issue or both.

Thank you for your collaboration.
Mauro frasson

Edited by MFrasson3344 on Jun 09, 2020 07:08 AM

API Support » "Market if touched" order type does not work properly in demo/developer accounts Jun 08, 2020 @ 02:25 PM (Total replies: 1)

The "Market if touched" order type seems
    not to work properly with demo / developer accounts:

    1) Enter a "Market if touched" order with quantity 10
    2) Change the quantity to 1
    3) Wait for the order execution

    The order is executed with quantity 10 and not 1.
    Mauro frasson


    API Support » SendOSOOrders instead of SendLinkedOrders Mar 19, 2020 @ 05:41 AM (Total replies: 1)

    I have seen that in the new (not yet official) API versions the SendLinkedOrders function has been deprecated. It has been replaced by SendOSOOrders. Do you confirm this?
    Mauro frasson


    API Support » Error when i call GF.Api.Impl.GFApi.CreateClient() Jan 31, 2020 @ 08:02 AM (Total replies: 10)

    NuGet package contains only 4 DLLs:
    GF.Api.dll
    GF.Api.Impl.dll
    GF.Api.Values.dll
    GF.Common.dll

    All others are embedded inside GF.Api.Impl.dll. This is my problem.
    In my case, to load them dynamically from a different path than the executable folder, I need to have all DLLs (not embedded).

    So I have 2 solutions:

    Solution n. 1:
    I put the 4 NuGet DLLs in the executable folder (not the best solution in my case);

    Solution n. 2:
    I insert all the DLLs (10+) in the folder where I want and dynamically load them.
    Mauro frasson

    Edited by MFrasson3344 on Jan 31, 2020 08:03 AM

    API Support » Error when i call GF.Api.Impl.GFApi.CreateClient() Jan 28, 2020 @ 02:13 PM (Total replies: 10)

    It's all right on my side. I added NuGet packages from the beginning exactly as you described.
    I probably couldn't explain myself well.
    I'll let you investigate using the test project above.

    Please answer only this question for now:
    What are the DLLs embedded in GF.Api.Impl.dll?

    Thanks
    Mauro frasson


    API Support » Request Daily Historical Data Jan 28, 2020 @ 11:05 AM (Total replies: 1)

    I am subscribing to daily historical data using this function:

    client.Subscriptions.Bars.Subscribe(contract.ID, client.Subscriptions.Bars.Duration.Create(StartingDate, EndingDate, GF.Api.Subscriptions.Continuity.OneTime), client.Subscriptions.Bars.Description.CreateDays(1))

    The callback occurs both on BarsReceived and on DayBarsReceived. Which one should I consider? Is my solution the best way to request daily historical data?

    Thanks
    Mauro frasson


    API Support » Error when i call GF.Api.Impl.GFApi.CreateClient() Jan 28, 2020 @ 10:51 AM (Total replies: 10)

    I use .NET Framework.

    Other information:

    The issue is that in the case of dynamic loading of DLLs, if they are not in the executable folder, loading does not find some of them. For example the SimpleInjector.dll and GF.SimpleInjector.dll and so on are not found. Basically all the DLLs embeded into GF.Api.Impl.dll are not found.

    In fact, if instead of taking them from NuGet I take them from the "GAIN\Trader Dev 4.0" folder (all the DLLs contained in) and copy them into the bin/dll folder of the test console application, everything works.
    In short, I need to physically have all the DLLs you use so that I can find and load them one by one. This solves the issue.

    So my question is:
    What exactly are all the DLLs you embed inside GF.Api.Impl.dll?
    Mauro frasson

    Edited by MFrasson3344 on Jan 28, 2020 10:53 AM
    Edited by MFrasson3344 on Jan 28, 2020 10:54 AM

    API Support » Error when i call GF.Api.Impl.GFApi.CreateClient() Jan 27, 2020 @ 01:09 PM (Total replies: 10)

    To reproduce the issue, try this "Visual Basic" console application:

    Add the 4 GF.API dlls to the project references and set "Copy Local" = FALSE.
    GF.Api.Values.dll
    GF.Common.dll
    GF.Api.dll
    GF.Api.Impl.dll

    Run 2 tests:

    First Test:
    1) Copy the 4 GF.API dlls in the folder "bin\Debug\dll\" (the DLLs will be loaded by AppDomain.CurrentDomain.AssemblyResolve)
    2) Run -> error!

    Second Test:
    1) Copy the 4 GF.API dlls in the "bin\Debug\" folder -> the same as the .exe (DLLs will be loaded automatically)
    2) Run -> OK!


    This is the console app code:


    Sub Main()
    AddHandler AppDomain.CurrentDomain.AssemblyResolve, AddressOf MyResolveEventHandler

    Main_Real()
    End Sub


    Public Sub Main_Real()
    Dim GFclient As GF.Api.IGFClient = GF.Api.Impl.GFApi.CreateClient()
    End Sub


    Private Function MyResolveEventHandler(ByVal sender As Object, ByVal args As ResolveEventArgs) As System.Reflection.[Assembly]
    Try
    Dim DLL_Name As String = New System.Reflection.AssemblyName(args.Name).Name

    If (String.IsNullOrWhiteSpace(DLL_Name) = False) Then
    Dim Path As String = System.IO.Path.Combine(My.Application.Info.DirectoryPath, "dll")

    Dim AssmbFullPath As String = System.IO.Path.Combine(Path, DLL_Name & ".dll")

    If (System.IO.File.Exists(AssmbFullPath) = True) Then
    Return System.Reflection.Assembly.LoadFrom(AssmbFullPath)
    End If
    End If
    Catch ex As Exception
    End Try

    Return Nothing
    End Function
    Mauro frasson


    API Support » Error when i call GF.Api.Impl.GFApi.CreateClient() Jan 24, 2020 @ 04:58 AM (Total replies: 10)

    I have more information:
    the issue occurs if I DO NOT insert your dll in the .exe file folder.

    In my case, your DLLs are located from a different folder than the .exe and I load them dynamically using AppDomain.CurrentDomain.AssemblyResolve.
    It seems that this loading type is not appropriate in your case. For what reason? Do your dlls load some internal dependency that is not found if the DLLs are in a different path than the .exe?
    Mauro frasson


    API Support » Error when i call GF.Api.Impl.GFApi.CreateClient() Jan 23, 2020 @ 09:54 AM (Total replies: 10)

    Hi,

    I am starting to use the new GFAPI. I am using Visual Basic .net as a development environment.

    I get an error when I try to create the client using the method:

    GF.Api.Impl.GFApi.CreateClient()

    This is the error in detail:

    A first chance exception of type 'System.MissingMethodException' occurred in GF.Api.Impl.dll

    System.MissingMethodException occurred
    HResult = -2146233069
    Message = Method not found 'Void GF.SimpleInjector.InternalConstructorResolutionBehavior..ctor (SimpleInjector.Container)'.
    Source = GF.Api.Impl
    StackTrace:
    in GF.Api.Impl.ApiCompositionRoot.Compose(Container container)
    in GF.Api.Impl.ApiCompositionRoot.Compose()
    in GF.Api.Impl.GFApi.CreateClient()
    InnerException:


    This error does NOT happen if I use your GF.AdvancedExample (c #) example.

    Any suggestions?
    Thank you.
    Mauro frasson


    API Support » Introducing Broker Sep 05, 2018 @ 09:19 AM (Total replies: 1)

    Hi,

    it is possible to have the introducing broker ID or Name or something like that (by API .NET) to identify who is the introducing broker?

    Thanks.
    Mauro frasson


    API Support » Bracket Order -> Price Modification Sep 14, 2017 @ 05:54 AM (Total replies: 5)

    Yes, I did not see the second overload of the function. Now works!

    And... Can you describe OSOGroupingMethod? I cannot find it in documentation.

    Thanks.
    Mauro frasson


    API Support » Trailing Stop Loss & Trailing Stop Limit Sep 08, 2017 @ 09:43 AM (Total replies: 5)

    Perfect! Good choice.

    Thanks
    Mauro frasson


    API Support » Bracket Order -> Price Modification Aug 24, 2017 @ 05:09 AM (Total replies: 5)

    I tried, but it does not work. I've tried setting DeltaTicks and DeltaTicks2 of the primary order, and then also of the linked orders, but nothing happens. The price of linked orders does not change if I change the price of the main order. If I change the quantity instead of the price, everything works.

    Are you sure DeltaTick and Deltatick2 work? Can you write a sample code please?
    Mauro frasson


    API Support » Trailing Stop Loss & Trailing Stop Limit Aug 24, 2017 @ 04:55 AM (Total replies: 5)

    >>What version are you using?
    Last Version -> 3.5.14.36 (Api.dll)
    Environment: Developer (api.gainfutures.com)


    >>Was the behavior different previously? If so, when did it change?
    I do not know. We are adding now Trailing Stop to our application.


    >>Could you please elaborate on the programmatic context in which you are seeing the missing ExtData?

    1) Insert a Trailing Stop Loss or a Trailing Stop Limit using SetTSData to set Reference and Delta (ExtData is not null)
    2) Wait until the price of trailing order change automatically.
    3) check the ExtData of order and you can see that it is null.
    Mauro frasson

    Edited by MFrasson3344 on Aug 24, 2017 07:57 AM
    Edited by MFrasson3344 on Aug 24, 2017 09:07 AM
    Edited by MFrasson3344 on Aug 24, 2017 09:08 AM

    API Support » Trailing Stop Loss & Trailing Stop Limit Aug 22, 2017 @ 08:04 AM (Total replies: 5)

    Hi,

    The ExtData of a Trailing Stop Loss and a Trailing Stop Limit order type is null after the first price update.
    Is this correct? or could be an API bug?
    Mauro frasson


    API Support » Bracket Order -> Price Modification Aug 22, 2017 @ 04:43 AM (Total replies: 5)

    Hi,

    If I place a bracket order from Trader Developer and I modify the price of the "main" order on DOM (drag & drop), the linked orders are changed maintaining the same offset.

    But, if I place a bracket order from my application and I modify the price of the "main" order from my application or from Trader developer the linked orders are NOT changed.

    I think I forgot to set some property. Maybe DeltaTicks and/or DeltaTicks2? And if so, how should they be set?

    Thank you.
    Mauro frasson


    API Support » OCO orders between 2 apps Jul 18, 2017 @ 01:11 PM (Total replies: 2)

    I connected Trader dev and my application at the same time.
    I have placed 2 OCO orders from Trader dev.
    My application correctly receives the various OnOrderStateChanged, OnOrderConfirmed events, but the OCO property of the order is empty. Instead, I would expect it to be valued.
    Now, if i disconnect my application and reconnect it, the OCO property is valued.

    I think there is a synchronization problem with OCO when 2 apps are connected at the same time.
    Mauro frasson


    API Support » Subscription disappeared Jun 13, 2017 @ 03:25 PM (Total replies: 1)

    In my own application i subscribe a symbol (for example "ESM7") to receive Price/Bid/Ask on OnPriceTick event.

    Now, if i execute an order (buy or sell is the same) using OEC Trader developer, and after i exit the position using "Exit All (MKT)" button (in the position form), the subscription of "ESM7" in my own application disappears.

    AutoSubscribe property is False. If i set AutoSubscribe = True the problem is solved.

    Could be an API bug?
    Edited by MFrasson3344 on Jun 13, 2017 03:51 PM

    API Support » What is the last API version? May 25, 2017 @ 06:17 PM (Total replies: 9)

    I found the problem. In the references I removed "System.Xml.Linq" and now your project is compiled successfully. There seems to be an ambiguous reference that the compiler fails to solve. So please, try to investigate about this conflict between System.Xml.Linq and your dlls (in particolar CommLib).

    Mauro frasson

    Edited by MFrasson3344 on May 25, 2017 06:17 PM
    Edited by MFrasson3344 on May 25, 2017 06:38 PM