Home Forums AmiBroker How to connect the Custom Bridge with AmiBroker?

How to connect the Custom Bridge with AmiBroker?

  • Author
    Posts
    • I have a strategy running in AmiBroker.

      What I want is that whenever a Buy signal comes from my strategy, the Future contract that I configured in the Up Side Execution should be traded automatically.

      Similarly, whenever a Sell signal comes, the script configured in the Down Side Execution should be executed.

      How can I integrate AmiBroker with AlgoDelta’s Custom Bridge?

    • Yes sir, you can definitely do that with the Custom Bridge.

      Just follow the steps below.

      Step 1:

      Go to: Bridge -> Custom Bridge

      Create and configure a Custom Bridge if you don’t already have one.

      Step 2:

      Configure your Upside Execution and Downside Execution according to your requirements.

      For example:

      Upside Execution:

      Exchange: NFO

      Script Type: Future

      Symbol: NIFTY

      Transaction Type: Buy

      Expiry Gap: 0

      Order Lot: 1

      Product: Carry Forward

      Similarly, configure the Downside Execution as required.

      Step 3:

      Copy the webhook URL using the yellow copy icon available on the Custom Bridge page.

      Step 4:

      Now open Ami Broker and go to the strategy code where your Buy and Sell conditions are written.

      Usually this will be inside the Formula Editor (AFL).

      Step 5:

      Add the following function to send signals to the AlgoDelta webhook:

      webhookURL = "URL";
      function placeBridgeOrder(webhookURL, trade_signal)
      {
          curlCmd = "curl --location ''' + webhookURL + ''' " +
                    "--header ''Content-Type: text/plain'' " +
                    "--data ''' + trade_signal + '''";
          _TRACE(curlCmd);
          ShellExecute( "cmd.exe", "/c " + curlCmd, "", 0 );
      }
      

      Step 6:

      Replace the URL value with your Custom Bridge webhook URL.

      Eg: https://apiv4.algodelta.com/api/v4/users/bridge/webhook/1709/AMITest

      Step 7:

      Now call the function wherever your Buy and Sell conditions become true.

      Buy Signal Example:

      if(LastValue(Buy))
      {
          placeBridgeOrder(webhookURL, "UP");
          _TRACE("UP");
      }
      

      Sell Signal Example:

      if(LastValue(Sell))
      {
      placeBridgeOrder(webhookURL, "DOWN");
      _TRACE("DOWN");
      }

      That’s it.

      Now whenever your Ami Broker strategy generates a Buy signal, it will send the message “UP” to AlgoDelta through the webhook and the Upside Execution configured in your Custom Bridge will be executed.

      Similarly, whenever a Sell signal is generated, it will send the message “DOWN” and the Downside Execution configured in your bridge will be executed automatically.

      So, this is how you can connect Ami Broker with AlgoDelta’s Custom Bridge and automate your trade execution.

      • Author↳ Replying to @Algodelta Support

        This is exactly what I am looking for, thanks for explaining all the things with images also. It’s help’s me a lot.

Viewing 1 reply thread
×

Start a Discussion

Get help from the AlgoDelta community.

×

Welcome Back!

Enter your email to sign in or create an account. No passwords needed.

Pending Approval

⚠️

Delete This?

Are you sure you want to delete this? This action is permanent and cannot be undone.

Scroll to Top