NexusFi: Find Your Edge


Home Menu

 





Strategy getting out of sync with real market position


Discussion in EasyLanguage Programming

Updated
    1. trending_up 4,397 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 1 attachments




 
Search this Thread

Strategy getting out of sync with real market position

  #1 (permalink)
9ypmhphony
Israel
 
Posts: 2 since May 2020
Thanks Given: 0
Thanks Received: 1

for some reason i see that the strategy has a position filled, but no position was filled. i guess it is because the the price reaching the BUY STOP during not regular trading hours, or maybe it has to do with IOG=TRUE. but not sure.

thanks to anyone that can help with this issue.

[IntrabarOrderGeneration = true]

Inputs:
Length(9),
Mult(1.25),
Capital(0),
Risk(100);

Vars:
MP(0),
kcUPband(0), kcDNband(0),
bbUPband(0), bbDNband(0),
dcUPband(0), dcDNband(0),
upBand(0), dnBand(0),
AvgBand(0),
VolGap(0),
VolShares(0),
QtyShares(0),
Split(0),
nShares(0);

MP = MarketPosition;
kcUPband = KeltnerEMA(C,Length,Mult);
kcDNband = KeltnerEMA(C,Length,-Mult);
bbUPband = BollingerBand(C,Length,Mult);
bbDNband = BollingerBand(C,Length,-Mult);
dcUPband = Highest(H,Length);
dcDNband = Lowest(L,Length);

upBand = minlist(kcUPband,bbUPband,dcUPband[1]);
dnBand = maxlist(kcDNband,bbDNband,dcDNband[1]);
AvgBand = (upBand+dnBand)/2;

if MP = 0 then
begin
VolGap = upBand-AvgBand;
if Capital <> 0 then
begin
VolShares = round(Risk/VolGap,0);
QtyShares = round(Capital/C,0);
nShares = minlist(VolShares,QtyShares);
end
else
nShares = round(Risk/VolGap,0);
Split = nShares/3;
buy next bar nShares shares at upBand stop;
end;

if MP = 1 then
begin
sell ("Exit") next bar at AvgBand stop;
sell Split shares total next bar at entryprice+VolGap*1.5 limit;
sell Split shares total next bar at entryprice+VolGap*3 limit;
end;

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
What broker to use for trading palladium futures
Commodities
 
  #2 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

Can you provide the timeframe of the chart and the instrument? I may be able to assist.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
9ypmhphony
Israel
 
Posts: 2 since May 2020
Thanks Given: 0
Thanks Received: 1




The issue occured during premarket (6/30/2020), after i logged in to tradestation.
i assume it was because of IOG. but not sure. another thing is that "Strategy Time Filled" is always 11:00pm. but i guess it's because I'm on daily timeframe.

anyway, thanks for your help.

Reply With Quote
Thanked by:
  #4 (permalink)
 
vmodus's Avatar
 vmodus 
Somewhere, Delaware, USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: Barchart.com
Trading: Everything, it all tastes like chicken
Posts: 1,271 since Feb 2017
Thanks Given: 2,958
Thanks Received: 2,853

The IOG=True setting means you are evaluating the criteria every tick, but your order will be placed at the close of the bar. I'm wondering if you are sending an order to the market when it is closed and TS is rejecting it because it is closed. I don't work with daily charts, so I'm not that much of a help.

You might want to pose your question in the TradeStation community forums.

~vmodus

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on July 1, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts