Help regarding modification in "Simple Trend Robot"
Help regarding modification in "Simple Trend Robot"
22 Feb 2013, 19:37
According to the conditions of "Sample Trend Robot" it opens and closes position immediately when the SMA crosses each other.
What I want is that the robot should check two conditions before opening and closing positions. They are:-
1) SMA Crosses each other and remain crossed in Last Candle and
2) Buy and Sell Order only takes place in New Candle Opening.
Can anyone code this thing.
Thanks.
Replies
susantasaren
26 Feb 2013, 23:56
RE: RE:
susantasaren said:According to the conditions of "Sample Trend Robot" it opens and closes position immediately when the SMA crosses each other.
What I want is that the robot should check two conditions before opening and closing positions. They are:-
1) SMA Crosses each other and remain crossed in Last Candle and
2) Buy and Sell Order only takes place in New Candle Opening.
Can anyone code this thing.
Thanks.
Therefore the only difference is that the SMA remain crossed for a while before a new order is requested? If so, for how many bars should they remain crossed?
You may want to look into the functions HasCrossedAbove/HasCrossedBelow.
This Image will explain what I want.
@susantasaren
susantasaren
27 Feb 2013, 06:25
RE: RE:
susantasaren said:According to the conditions of "Sample Trend Robot" it opens and closes position immediately when the SMA crosses each other.
What I want is that the robot should check two conditions before opening and closing positions. They are:-
1) SMA Crosses each other and remain crossed in Last Candle and
2) Buy and Sell Order only takes place in New Candle Opening.
Can anyone code this thing.
Thanks.
Therefore the only difference is that the SMA remain crossed for a while before a new order is requested? If so, for how many bars should they remain crossed?
You may want to look into the functions HasCrossedAbove/HasCrossedBelow.
Thanks. HasCrossedAbove and HasCrossedBelow functions solves my purpose. :)
@susantasaren
cAlgo_Fanatic
26 Feb 2013, 10:17
RE:
Therefore the only difference is that the SMA remain crossed for a while before a new order is requested? If so, for how many bars should they remain crossed?
You may want to look into the functions HasCrossedAbove/HasCrossedBelow.
@cAlgo_Fanatic