I have a strategy that is executing correctly on backtesting but not live. I am using IQfeed as my data feed and OEC as my broker.
Basically i have a settargetproifit(500); which works out just find in backtesting but when going live it wont hold for the 500 dollar value and instead takes me out as 1 tick profit.
Please advise.
Thanks
Strategy
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Strategy
can't help you without knowing the following:I have a strategy that is executing correctly on backtesting but not live. I am using IQfeed as my data feed and OEC as my broker.
Basically i have a settargetproifit(500); which works out just find in backtesting but when going live it wont hold for the 500 dollar value and instead takes me out as 1 tick profit.
Please advise.
Thanks
1. what is the instrument
2. what is the chart resolution
3. your code
Re: Strategy
1.The instrument is the @EU# using IQfeed and 6EZ1 using OEC. I have both mapped. The IQfeed is the chart and has the 6EZ1 from OEC mapped to the chart as to send signals to OEC.
2.The chart resolution is a 1hr chart with 1000 bars back.
3.the code is below:
the setprofittarget does not seem to work once i map OEC as my broker, but works fine on iqfeed by itself.
2.The chart resolution is a 1hr chart with 1000 bars back.
3.the code is below:
Code: Select all
vars: mystoploss(0);
if MarketPosition = 0 and close > close[1] then begin
mystoploss = Highest(high, 4)[0];
sellshort ("SSS") 1 contracts next bar at market;
end;
if MarketPosition = -1 then
buytocover ("XS2") next bar at mystoploss stop;
setprofittarget(500);
the setprofittarget does not seem to work once i map OEC as my broker, but works fine on iqfeed by itself.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Strategy
1.The instrument is the @EU# using IQfeed and 6EZ1 using OEC. I have both mapped. The IQfeed is the chart and has the 6EZ1 from OEC mapped to the chart as to send signals to OEC.
2.The chart resolution is a 1hr chart with 1000 bars back.
3.the code is below:
vars: mystoploss(0);
if MarketPosition = 0 and close > close[1] then begin
mystoploss = Highest(high, 4)[0];
sellshort ("SSS") 1 contracts next bar at market;
end;
if MarketPosition = -1 then
buytocover ("XS2") next bar at mystoploss stop;
setprofittarget(500);
the setprofittarget does not seem to work once i map OEC as my broker, but works fine on iqfeed by itself.
1. please use code tag when posting codes. It makes reading codes easier. I have tagged them for you in your post.
2. are you using intrabarordergeneration?
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Strategy
I have just tested the code. It works fine on the HSI 1 min chart.No i am not using interbarordergeneration
Please check your big point value of the instrument.
If you still have problem,
Please post a screen shot of a test run.
attached see my test run.
- Attachments
-
- HSI test run.gif
- (25.56 KiB) Downloaded 427 times
Re: Strategy
Yes i know it works when you just apply it as is. But try mapping it, and then youll get the errors. Have your tried using iqfeed or esginal or a feed and then mapping the broker such as OEC or interactive brokers. Then apply the strategy and youll see it doesnt work. Please see attached.
- Attachments
-
- incorrect.JPG
- (50.13 KiB) Downloaded 415 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Strategy
Please check the big point value.Yes i know it works when you just apply it as is. But try mapping it, and then youll get the errors. Have your tried using iqfeed or esginal or a feed and then mapping the broker such as OEC or interactive brokers. Then apply the strategy and youll see it doesnt work. Please see attached.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Strategy
The bpv is given by the exchange for a specific instrument. These numbers should not be modified.bpv on oec is 1250
bpv on iqfeed is 125000
what am i supposed to do?
Having said that,
the numbers for the same instrument should be the same.
Please change the OEC bpv value to 125000 and see if it works.