- Home
- Forum
- cTrader Automate
- Unable to load DLL 'winhttp.dll' or one of its dependencies
Unable to load DLL 'winhttp.dll' or one of its dependencies
Unable to load DLL 'winhttp.dll' or one of its dependencies
Hi,
I am trying to build this cbot from the indicator referenced below.
However, I keep getting the error [Crashed in Initialize with DllNotFoundException: Unable to load DLL 'winhttp.dll'] when I try to run an instance of this cbot. What could be the issue.
Kindly advise.
Joyce.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo.Robots
{
[Robot(AccessRights = AccessRights.None)]
public class Swing : Robot
{
private Swing xyz;
protected override void OnStart()
{
xyz = Indicators.GetIndicator<Swing>(Bars.ClosePrices, Bars.ClosePrices, 5);
}
protected override void OnBar()
{
var currentSwingHigh = xyz.SwingHighPlot.Last(0);
var currentSwingLow = xyz.SwingLowPlot.Last(0);
var Price = (Symbol.Ask + Symbol.Bid)/2;
if ((Price > currentSwingLow)||(Price > currentSwingHigh))
{
Close(TradeType.Sell, "test");
if (Positions.Count == 0)
ExecuteMarketOrder(TradeType.Buy, SymbolName, 1000, "Bullish", 50, 100);
}
if ((Price < currentSwingLow)||(Price < currentSwingHigh))
{
Close(TradeType.Buy, "test");
if (Positions.Count == 0)
ExecuteMarketOrder(TradeType.Sell, SymbolName, 1000, "Bearish", 50, 100);
}
}
private void Close(TradeType tradeType, string Label)
{
foreach (var position in Positions.FindAll(Label, SymbolName, tradeType))
ClosePosition(position);
}
}
}
Copyright © 2023 Spotware Systems Ltd. All rights reserved.