Is there something that I'm doing wrong?
Code: Select all
if MarketPosition = 0 then begin
print ("MarketPosition = 0");
print (OrderText);
if OrderText = "SELL" then begin
print ("SELL LIMIT SHORT");
SellShort ("Sell1") 1 Contracts Next Bar At (OrderEntryPrice) Limit;
SetProfitTarget(500);
Setbreakeven(60);
SetStopLoss(100);
print ("SELL LIMIT SHORT EXECUTED");
end;
if OrderText = "BUY" then begin
print ("BUY LIMIT LONG");
Buy("Buy1") 1 Contracts Next Bar At (OrderEntryPrice) Limit;
SetProfitTarget(500);
Setbreakeven(60);
SetStopLoss(100);
print ("BUY LIMIT LONG EXECUTED");
end;
end;