Let's say - I have 4 contracts long and would like:
- Sell 2 contracts for 1 tick profit
- Sell 2 contracts for 2 ticks profit
- Stop loss 8 ticks for all 4 contracts
Can someone help with pseudo code for achieving it with the help of "setprofittarget" ( wanted to avoid "sell limit" or "sell stop" commands if possible).
Thanks
----
Code: Select all
Vars: FirstPass(True);
if FirstPass and Marketposition=0 then begin
buy 4 contracts next bar market;
end;
if MarketPosition<>0 then begin
FirstPass=False;
<... Stoploss 8 ticks for all contracts .. using ....any of the other keywords
SetStopPosition.. or SetStopContract.. or ..SetStopLoss...>
<....Sell 2 contracts at 1 tick profit - using setprofittarget code....>
<...Sell 2 contracts at 2 ticks profilt - using setprofittarget code...>
end;