I'm trying to write simple strategy. Code is OK and building. But after I copy it to FT2/Strategy folder - I can't see my dll file in list of strategies. Can somebody help me?
My code:
Code: Select all
#include <windows.h>
#include "StrategyInterfaceUnit.h"
#include "TechnicalFunctions.h"
// external parameters
int Type = 1;
double Lot = 0.1;
int SL = 20;
int TP = 20;
// internal variables
//-----Init strategy----------------------------------------------------------
EXPORT void __stdcall InitStrategy()
{
StrategyShortName("test");
StrategyDescription("This strategy does something");
RegOption("Type", ot_Integer, &Type);
RegOption("Lot", ot_Double, &Lot);
RegOption("SL", ot_Integer, &SL);
RegOption("TP", ot_Integer, &TP);
}
//-----Process single tick----------------------------------------------------
EXPORT void __stdcall GetSingleTick()
{
int OrderHandle;
if (OrdersTotal() == 0) {
if(Type == 1){
SendInstantOrder(Symbol() ,op_Buy,Lot, (Ask() - SL*Point()), (Ask() + TP*Point()), "testbuy", 0, OrderHandle);
}else{
SendInstantOrder(Symbol() ,op_Buy,Lot, (Bid() + SL*Point()), (Bid() - TP*Point()), "testsell", 0, OrderHandle);
}
}
}